Skip to main content
In this lesson, you’ll learn how to manage system services with Upstart, switch runlevels, and handle system shutdowns and reboots. We’ll cover core commands, scheduling techniques, and best practices for both Upstart and systemd environments.

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.
Use these commands to control services:

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

The shutdown utility wraps System V runlevel transitions with extra safeguards:
  • Broadcasts a warning to all logged-in users
  • Blocks new logins during shutdown
  • Sends SIGTERM then SIGKILL to processes
  • Transitions to runlevel 0 (halt) or 6 (reboot)
By default, 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.

Broadcasting Messages with wall

If you only need to notify users without shutting down:

Watch Video