init
Upstart process management daemon
- Provided by: upstart (Version: 1.12.1-0ubuntu4.2)
- Report a bug
Upstart process management daemon
init [OPTION]...
init is the parent of all processes on the system, it is executed by the kernel and is responsible for starting all other processes; it is the parent of all processes whose natural parents have died and it is responsible for reaping those when they die.
Processes managed by init are known as jobs and are defined by files in the /etc/init directory. See init(5) for more details on configuring Upstart.
init(8) is an event-based init daemon. This means that jobs will be automatically started and stopped by changes that occur to the system state, including as a result of jobs starting and stopping.
This is different to dependency-based init daemons which start a specified set of goal jobs, and resolve the order in which they should be started and other jobs required by iterating their dependencies.
For more information on starting and stopping jobs, as well as emitting events that will automatically start and stop jobs, see the manual page for the initctl(8) tool.
The primary event is the startup(7) event, emitted when the daemon has finished loading its configuration. Other useful events are the starting(7), started(7), stopping(7) and stopped(7) events emitted as jobs change state.
Table 1: Job Goals and State Transitions.
| Goal | ||
| Current State | start | stop |
| waiting | starting | n/a |
| starting | pre-start | stopping |
| pre-start | spawned | stopping |
| spawned | post-start | stopping |
| post-start | running | stopping |
| running | stopping | pre-stop / stopping (*) |
| pre-stop | running | stopping |
| stopping | killed | killed |
| killed | post-stop | post-stop |
| post-stop | starting | waiting |
Key:
(*) If there is a script or exec section and this process is
running,
state will be 'pre-stop', else it will be 'stopping'.
For services, when this event completes the main process will now be fully running. If the job refers to a task, it will now have completed (successfully or otherwise).
When this event completes, the job is fully stopped.
The Upstart init(8) daemon does not keep track of runlevels itself, instead they are implemented entirely by its userspace tools. The event emitted to signify a change of runlevel is the runlevel(7) event. For more information see its manual page.
Options are passed to init(8) by placing them on the kernel command-line.
When running as process ID 1, the last directory specified will be used.
In user session mode, multiple directories will be honoured and job configuration files loaded from the directories in the order specified.
init is not normally executed by a user process, and expects to have a process id of 1. If this is not the case, it will actually execute telinit(8) and pass all arguments to that. See that manual page for further details. However, if the --user option is specified, it will run as a Session Init and read alternative configuration files and manage the individual user session in a similar fashion.
Sending a Session Init a SIGTERM signal is taken as a request to shutdown due to an impending system shutdown. In this scenario, the Session Init will emit the session-end event and request all running jobs stop. It will attempt to honour jobs kill timeout values (see init(5) for further details). Note however that system policy will prevail: if jobs request timeout values longer than the system policy allows for complete system shutdown, it will not be possible to honour them before the Session Init is killed by the system.
When run as a user process, the following variables may be used to find job configuration files:
See User Session Mode in init(5) for further details.
/etc/init.conf
/etc/init/
$HOME/.init/
$XDG_CONFIG_DIRS/upstart/
$XDG_CONFIG_HOME/upstart/
Written by Scott James Remnant <scott@netsplit.com>
Report bugs at <https://launchpad.net/upstart/+bugs>
Copyright © 2009-2013 Canonical Ltd.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.
all-swaps(7), control-alt-delete(7), dbus-daemon(1), dbus-event(7), dconf-event(7), file-event(7), filesystem(7), init(5), init(8), initctl(8), keyboard-request(7), local-filesystems(7), mountall(8), mounted(7), mounting(7), power-status-changed(7), remote-filesystems(7), runlevel(7), shutdown(8), socket-event(7), started(7), starting(7), startup(7), stopped(7), stopping(7), telinit(8), upstart-dbus-bridge(8), upstart-dconf-bridge(8), upstart-event-bridge(8), upstart-events(7), upstart-file-bridge(8), upstart-local-bridge(8), upstart-socket-bridge(8), upstart-udev-bridge(8), virtual-filesystems(7).