Controlling Services with Upstart
Upstart job definitions reside in/etc/init. You can list all available services and their current states (including PIDs) using initctl list:
Upstart jobs live under
/etc/init. To add or modify a job, create or edit its .conf file in this directory.Querying and Switching Runlevels
Although Upstart doesn’t use/etc/inittab, you can still use the legacy commands:
Note: Runlevels 0 and 6 correspond to halt and reboot in System V–style init.
System Shutdown and Reboot
Theshutdown utility wraps System V runlevel transitions with extra safeguards:
- Broadcasts a warning to all logged-in users
- Blocks new logins during shutdown
- Sends
SIGTERMthenSIGKILLto processes - Transitions to runlevel 0 (halt) or 6 (reboot)
shutdown without -h or -r switches to single-user mode (runlevel 1).
Scheduling a Shutdown
The<time> argument is mandatory and accepts:
Optionally include a broadcast message:
Scheduling or initiating a shutdown requires root privileges. Ensure you have the proper permissions before running these commands.
SysV vs. systemd Commands
On System V–based distributions,shutdown handles power actions. On systemd-based systems, use the following equivalents:
For Ctrl+Alt+Delete behavior on SysV, you can limit authorized users in
/etc/shutdown.allow.