Linux "init" Command Line Options and Examples
systemd system and service manager

systemd is a system and service manager for Linux operating systems. When run as first process on boot (as PID 1), it acts as init system that brings up and maintains userspace services. For compatibility with SysV, if systemd is called as init and a PID that is not 1, it will execute telinit and pass all command line arguments unmodified.


/lib/systemd/systemd [OPTIONS...]

    init [OPTIONS...] {COMMAND}

Command Line Options:

Determine startup sequence, dump it and exit. This is an option useful for debugging only.
init --test ...
Dump understood unit configuration items. This outputs a terse but complete list of configuration items understood in unitdefinition files.
init --dump-configuration-items ...
Set default unit to activate on startup. If not specified, defaults to
init --unit ...
For --system, tell systemd to run a system instance, even if the process ID is not 1, i.e. systemd is not run as init process.
init --system ...
Enable core dumping on crash. This switch has no effect when running as user instance. This setting may also be enabled duringboot on the kernel command line via the systemd.dump_core= option, see below.
init --dump-core ...
Switch to a specific virtual console (VT) on crash. Takes a positive integer in the range 1–63, or a boolean argument. If aninteger is passed, selects which VT to switch to. If yes, the VT kernel messages are written to is selected. If no, no VT switchis attempted. This switch has no effect when running as user instance. This setting may also be enabled during boot, on thekernel command line via the systemd.crash_vt= option, see below.
init --crash-vt ...
Run a shell on crash. This switch has no effect when running as user instance. This setting may also be enabled during boot, onthe kernel command line via the systemd.crash_shell= option, see below.
init --crash-shell ...
Automatically reboot the system on crash. This switch has no effect when running as user instance. This setting may also beenabled during boot, on the kernel command line via the systemd.crash_reboot= option, see below.
init --crash-reboot ...
Ask for confirmation when spawning processes. This switch has no effect when run as user instance.
init --confirm-spawn ...
Takes a boolean argument or the special value auto. If on, terse unit status information is shown on the console during boot-upand shutdown. If off, no such status information is shown. If set to auto behavior is similar to off, except that it isautomatically switched to on, as soon as the first unit failure or significant boot delay is encountered. This switch has noeffect when invoked as user instance. If specified, overrides both the kernel command line setting systemd.show_status= (seebelow) and the configuration file option ShowStatus=, see systemd-system.conf(5).
init --show-status ...
Set log target. Argument must be one of console, journal, kmsg, journal-or-kmsg, null.
init --log-target ...
Set log level. As argument this accepts a numerical log level or the well-known syslog(3) symbolic names (lowercase): emerg,alert, crit, err, warning, notice, info, debug.
init --log-level ...
Highlight important log messages. Argument is a boolean value. If the argument is omitted, it defaults to true.
init --log-color ...
Include code location in log messages. This is mostly relevant for debugging purposes. Argument is a boolean value. If theargument is omitted it defaults to true.
init --log-location ...
Sets the default output or error output for all services and sockets, respectively. That is, controls the default forStandardOutput= and StandardError= (see systemd.exec(5) for details). Takes one of inherit, null, tty, journal, journal+console,syslog, syslog+console, kmsg, kmsg+console. If the argument is omitted --default-standard-output= defaults to journal and
init --default-standard-output ...
Override the machine-id set on the hard drive, useful for network booting or for containers. May not be set to all zeros.
init --machine-id ...
Globally enable/disable all service watchdog timeouts and emergency actions. This setting may also be specified during boot, onthe kernel command line via the systemd.service_watchdogs= option, see below. Defaults to enabled.
init --service-watchdogs ...
Print a short help text and exit.
init -h ...
Print a short version string and exit.CONCEPTSsystemd provides a dependency system between various entities called "units" of 11 different types. Units encapsulate various objectsthat are relevant for system boot-up and maintenance. The majority of units are configured in unit configuration files, whose syntaxand basic set of options is described in systemd.unit(5), however some are created automatically from other configuration,dynamically from system state or programmatically at runtime. Units may be "active" (meaning started, bound, plugged in, ...,depending on the unit type, see below), or "inactive" (meaning stopped, unbound, unplugged, ...), as well as in the process of beingactivated or deactivated, i.e. between the two states (these states are called "activating", "deactivating"). A special "failed"state is available as well, which is very similar to "inactive" and is entered when the service failed in some way (process returnederror code on exit, or crashed, an operation timed out, or after too many restarts). If this state is entered, the cause will belogged, for later reference. Note that the various unit types may have a number of additional substates, which are mapped to the fivegeneralized unit states described here.The following unit types are available:1. Service units, which start and control daemons and the processes they consist of. For details, see systemd.service(5).2. Socket units, which encapsulate local IPC or network sockets in the system, useful for socket-based activation. For details aboutsocket units, see systemd.socket(5), for details on socket-based activation and other forms of activation, see daemon(7).3. Target units are useful to group units, or provide well-known synchronization points during boot-up, see Device units expose kernel devices in systemd and may be used to implement device-based activation. For details, seesystemd.device(5).5. Mount units control mount points in the file system, for details see systemd.mount(5).6. Automount units provide automount capabilities, for on-demand mounting of file systems as well as parallelized boot-up. Seesystemd.automount(5).7. Timer units are useful for triggering activation of other units based on timers. You may find details in systemd.timer(5).8. Swap units are very similar to mount units and encapsulate memory swap partitions or files of the operating system. They aredescribed in systemd.swap(5).9. Path units may be used to activate other services when file system objects change or are modified. See systemd.path(5).10. Slice units may be used to group units which manage system processes (such as service and scope units) in a hierarchical tree forresource management purposes. See systemd.slice(5).11. Scope units are similar to service units, but manage foreign processes instead of starting them as well. See systemd.scope(5).Units are named as their configuration files. Some units have special semantics. A detailed list is available in systemd.special(7).systemd knows various kinds of dependencies, including positive and negative requirement dependencies (i.e. Requires= andConflicts=) as well as ordering dependencies (After= and Before=). NB: ordering and requirement dependencies are orthogonal. If onlya requirement dependency exists between two units (e.g. foo.service requires bar.service), but no ordering dependency ( after bar.service) and both are requested to start, they will be started in parallel. It is a common pattern that bothrequirement and ordering dependencies are placed between two units. Also note that the majority of dependencies are implicitlycreated and maintained by systemd. In most cases, it should be unnecessary to declare additional dependencies manually, however it ispossible to do this.Application programs and units (via dependencies) may request state changes of units. In systemd, these requests are encapsulated as'jobs' and maintained in a job queue. Jobs may succeed or can fail, their execution is ordered based on the ordering dependencies ofthe units they have been scheduled for.On boot systemd activates the target unit whose job is to activate on-boot services and other on-boot units by pullingthem in via dependencies. Usually, the unit name is just an alias (symlink) for either (for fully-featured bootsinto the UI) or (for limited console-only boots for use in embedded or server environments, or similar; a subset However, it is at the discretion of the administrator to configure it as an alias to any other target unit. Seesystemd.special(7) for details about these target units.Processes systemd spawns are placed in individual Linux control groups named after the unit which they belong to in the privatesystemd hierarchy. (see cgroups.txt[1] for more information about control groups, or short "cgroups"). systemd uses this toeffectively keep track of processes. Control group information is maintained in the kernel, and is accessible via the file systemhierarchy (beneath /sys/fs/cgroup/systemd/), or in tools such as systemd-cgls(1) or ps(1) (ps xawf -eo pid,user,cgroup,args isparticularly useful to list all processes and the systemd units they belong to.).systemd is compatible with the SysV init system to a large degree: SysV init scripts are supported and simply read as an alternative(though limited) configuration file format. The SysV /dev/initctl interface is provided, and compatibility implementations of thevarious SysV client tools are available. In addition to that, various established Unix functionality such as /etc/fstab or the utmpdatabase are supported.systemd has a minimal transaction system: if a unit is requested to start up or shut down it will add it and all its dependencies toa temporary transaction. Then, it will verify if the transaction is consistent (i.e. whether the ordering of all units iscycle-free). If it is not, systemd will try to fix it up, and removes non-essential jobs from the transaction that might remove theloop. Also, systemd tries to suppress non-essential jobs in the transaction that would stop a running service. Finally it is checkedwhether the jobs of the transaction contradict jobs that have already been queued, and optionally the transaction is aborted then. Ifall worked out and the transaction is consistent and minimized in its impact it is merged with all already outstanding jobs and addedto the run queue. Effectively this means that before executing a requested operation, systemd will verify that it makes sense, fixingit if possible, and only failing if it really cannot work.systemd contains native implementations of various tasks that need to be executed as part of the boot process. For example, it setsthe hostname or configures the loopback network device. It also sets up and mounts various API file systems, such as /sys or /proc.For more information about the concepts and ideas behind systemd, please refer to the Original Design Document[2].Note that some but not all interfaces provided by systemd are covered by the Interface Stability Promise[3].Units may be generated dynamically at boot and system manager reload time, for example based on other configuration files orparameters passed on the kernel command line. For details, see systemd.generator(7).Systems which invoke systemd in a container or initrd environment should implement the Container Interface[4] or initrd Interface[5]specifications, respectively.DIRECTORIESSystem unit directoriesThe systemd system manager reads unit configuration from various directories. Packages that want to install unit files shallplace them in the directory returned by pkg-config systemd --variable=systemdsystemunitdir. Other directories checked are/usr/local/lib/systemd/system and /lib/systemd/system. User configuration always takes precedence. pkg-config systemd
init --version ...
SIGRTMIN+4Powers off the machine, starts the unit. This is mostly equivalent to systemctl start
init --job-mode ...
systemd.setenv=Takes a string argument in the form VARIABLE=VALUE. May be used to set default environment variables to add to forked childprocesses. May be used more than once to set multiple variables.systemd.machine_id=Takes a 32 character hex value to be used for setting the machine-id. Intended mostly for network booting where the samemachine-id is desired for every boot.systemd.unified_cgroup_hierarchyWhen specified without an argument or with a true argument, enables the usage of unified cgroup hierarchy[8] (a.k.a. cgroups-v2).When specified with a false argument, fall back to hybrid or full legacy cgroup hierarchy.If this option is not specified, the default behaviour is determined during compilation (the --with-default-hierarchy= option).If the kernel does not support unified cgroup hierarchy, the legacy hierarchy will be used even if this option is specified.systemd.legacy_systemd_cgroup_controllerTakes effect if the full unified cgroup hierarchy is not used (see previous option). When specified without an argument or with atrue argument, disables the use of "hybrid" cgroup hierarchy (i.e. a cgroups-v2 tree used for systemd, and legacy cgrouphierarchy[9], a.k.a. cgroups-v1, for other controllers), and forces a full "legacy" mode. When specified with a false argument,enables the use of "hybrid" hierarchy.If this option is not specified, the default behaviour is determined during compilation (the --with-default-hierarchy= option).If the kernel does not support unified cgroup hierarchy, the legacy hierarchy will be used even if this option is specified.quietTurn off status output at boot, much like systemd.show_status=false would. Note that this option is also read by the kernelitself and disables kernel log output. Passing this option hence turns off the usual output from both the system manager and thekernel.debugTurn on debugging output. This is equivalent to systemd.log_level=debug. Note that this option is also read by the kernel itselfand enables kernel debug output. Passing this option hence turns on the debug output from both the system manager and the kernel.emergency, rd.emergency, -bBoot into emergency mode. This is equivalent to or, respectively,and provided for compatibility reasons and to be easier to type.rescue, rd.rescue, single, s, S, 1Boot into rescue mode. This is equivalent to or, respectively, andprovided for compatibility reasons and to be easier to type.2, 3, 4, 5Boot into the specified legacy SysV runlevel. These are equivalent to,,, and, respectively, and provided forcompatibility reasons and to be easier to type.locale.LANG=, locale.LANGUAGE=, locale.LC_CTYPE=, locale.LC_NUMERIC=, locale.LC_TIME=, locale.LC_COLLATE=, locale.LC_MONETARY=,locale.LC_MESSAGES=, locale.LC_PAPER=, locale.LC_NAME=, locale.LC_ADDRESS=, locale.LC_TELEPHONE=, locale.LC_MEASUREMENT=,locale.LC_IDENTIFICATION=Set the system locale to use. This overrides the settings in /etc/locale.conf. For more information, see locale.conf(5) andlocale(7).For other kernel command line parameters understood by components of the core OS, please refer to kernel-command-line(7).SOCKETS AND FIFOS/run/systemd/notifyDaemon status notification socket. This is an AF_UNIX datagram socket and is used to implement the daemon notification logic asimplemented by sd_notify(3)./run/systemd/privateUsed internally as communication channel between systemctl(1) and the systemd process. This is an AF_UNIX stream socket. Thisinterface is private to systemd and should not be used in external projects./dev/initctlLimited compatibility support for the SysV client interface, as implemented by the systemd-initctl.service unit. This is a namedpipe in the file system. This interface is obsolete and should not be used in new applications.
init --default-standard-error= ...