Upstart is an event-based init system used in some upstart linux distributions to manage services and tasks during boot and while the system is running. It operates through a system of jobs and events. While tracing the origin of every event can be complex, often requiring you to explore job configurations in /etc/init, you will more commonly need to manage these jobs directly from the command line. The initctl utility provides a suite of commands for this purpose.
Viewing Job Status
To see a list of all known Upstart jobs and their current states, use the list command.
initctl list
shutdown stop/waiting
console stop/waiting
...
The output displays the job name, its goal, and its current status. In the example shutdown stop/waiting, the job name is shutdown, its goal is stop, and its current status is waiting. The job status and goals will change as you interact with them.
To check the status of a specific job, use the status command.
initctl status networking
networking start/running
Manually Controlling Jobs
While job configuration files in /etc/init define how jobs start, stop, and interact with events, you can manually override these actions using initctl. This is useful for troubleshooting or performing administrative tasks.
To manually start a job:
sudo initctl start networking
To manually stop a job:
sudo initctl stop networking
To manually restart a job, which is a convenient shortcut for stopping and then starting it:
sudo initctl restart networking
Emitting Custom Events
Upstart jobs are triggered by events. You can also manually "emit" an event, which can be useful for triggering custom jobs or for testing purposes. Any job that is configured to start on some_event would be triggered by the following command.
sudo initctl emit some_event