Operations 24 min read

Understanding Upstart: Features, Concepts, and Usage in Linux Init Systems

This article explains the evolution of Linux init systems, focusing on Upstart's event‑driven design, core concepts such as jobs and events, configuration syntax, and practical commands for developers and administrators, highlighting its advantages over traditional SysVinit.

Qunar Tech Salon
Qunar Tech Salon
Qunar Tech Salon
Understanding Upstart: Features, Concepts, and Usage in Linux Init Systems

In recent years the Linux init process has evolved from the traditional SysVinit to newer systems such as Upstart and systemd, with most modern distributions now adopting systemd. This second part of a series introduces Upstart, its motivations, and why Ubuntu and other distributions chose it.

Upstart was created to address the shortcomings of SysVinit in laptop and desktop environments where hardware is frequently added or removed. SysVinit starts all services unconditionally, leading to wasted resources when devices like printers or network shares are absent. Upstart uses an event‑driven model: when a device is detected (e.g., a USB drive), the kernel notifies udev, which emits an event that can start the appropriate job, reducing boot time and improving power efficiency.

The core concepts of Upstart are jobs and events . A job is a unit of work (service, task, or abstract job) defined in a configuration file under /etc/init/*.conf . Jobs wait for one or more events; when an event occurs, the job is triggered. Jobs have a lifecycle with states such as Waiting, Starting, Running, Stopping, and Killed, and certain state changes generate events (e.g., starting , started , stopping , stopped ).

Job configuration files consist of stanzas. Important stanzas include:

description "..."

author "..."

start on EVENT [and|or EVENT...]

stop on EVENT

expect fork or expect daemonize to declare how many times the service forks

exec COMMAND or script … end script to run commands

Example of a minimal job file:

# This is a simple demo of Job Configure file
# This line is comment, start with #
# Stanza 1, The author
author "Liu Ming"

# Stanza 2, Description
description "This job only has author and description, so no use, just a demo"

A more realistic job, mountall.conf , shows the use of script and exec :

# mountall.conf
description "Mount filesystems on boot"
start on startup
stop on starting rcS
...
script
  . /etc/default/rcS
  [ -f /forcefsck ] && force_fsck="--force-fsck"
  [ "$FSCKFIX"="yes" ] && fsck_fix="--fsck-fix"
  ...
exec mountall --daemon $force_fsck $fsck_fix
end script
...

Upstart also manages user session initialization. While most distributions still use traditional session start‑up, Ubuntu’s Raring release uses Upstart to start the user session after the display manager (lightdm) launches Xorg and then a session‑init job runs as a normal user.

System developers need to write proper job files and obey rules such as declaring the number of forks, handling SIGHUP for configuration reloads, and responding correctly to SIGTERM . Administrators use the initctl command suite to list, start, stop, restart, and reload jobs, e.g.:

$ initctl list
alsa-mixer-save stop/waiting
avahi-daemon start/running, process 690
mountall-net stop/waiting
rc stop/waiting
rsyslog start/running, process 482
...

Typical initctl commands mirror the classic service utility:

Service command

Upstart initctl command

service start

initctl start

service stop

initctl stop

service restart

initctl restart

service reload

initctl reload

Overall, Upstart provides a more flexible, event‑driven approach compared with SysVinit, allowing faster boot times and better resource usage, especially on desktops and portable devices. Although systemd has become the dominant init system, understanding Upstart remains valuable for system developers and administrators.

System Administrationevent-drivenService ManagementsystemdLinux initUpstart
Qunar Tech Salon
Written by

Qunar Tech Salon

Qunar Tech Salon is a learning and exchange platform for Qunar engineers and industry peers. We share cutting-edge technology trends and topics, providing a free platform for mid-to-senior technical professionals to exchange and learn.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.