1SYSTEMD(1) systemd SYSTEMD(1)
2
3
4
6 systemd, init - systemd System and Session Manager
7
9 systemd [OPTIONS...]
10
11 init [OPTIONS...] {COMMAND}
12
14 systemd is a system and session manager for Linux operating systems.
15 When run as first process on boot (as PID 1), it acts as init system
16 that brings up and maintains userspace services.
17
18 For compatibility with SysV, if systemd is called as init and a PID
19 that is not 1, it will execute telinit and pass all command line
20 arguments unmodified. That means init and telinit are mostly equivalent
21 when invoked from normal login sessions. See telinit(8) for more
22 information.
23
24 When run as system instance, systemd interprets the configuration file
25 system.conf, otherwise session.conf. See systemd.conf(5) for more
26 information.
27
29 The following options are understood:
30
31 -h, --help
32 Prints a short help text and exits.
33
34 --test
35 Determine startup sequence, dump it and exit. This is an option
36 useful for debugging only.
37
38 --dump-configuration-items
39 Dump understood unit configuration items. This outputs a terse but
40 complete list of configuration items understood in unit definition
41 files.
42
43 --introspect=
44 Extract D-Bus interface introspection data. This is mostly useful
45 at install time to generate data suitable for the D-Bus interfaces
46 repository. Optionally the interface name for the introspection
47 data may be specified. If omitted, the introspection data for all
48 interfaces is dumped.
49
50 --unit=
51 Set default unit to activate on startup. If not specified defaults
52 to default.target.
53
54 --system, --session
55 Tell systemd to run a system instance (resp. session instance),
56 even if the process ID is not 1 (resp. is 1), i.e. systemd is not
57 (resp. is) run as init process. Normally it should not be necessary
58 to pass these options, as systemd automatically detects the mode it
59 is started in. These options are hence of little use except for
60 debugging.
61
62 --dump-core
63 Dump core on crash. This switch has no effect when run as session
64 instance.
65
66 --crash-shell
67 Run shell on crash. This switch has no effect when run as session
68 instance.
69
70 --confirm-spawn
71 Ask for confirmation when spawning processes. This switch has no
72 effect when run as session instance.
73
74 --show-status=
75 Show terse service status information while booting. This switch
76 has no effect when run as session instance. Takes a boolean
77 argument which may be omitted which is interpreted as true.
78
79 --sysv-console=
80 Controls whether output of SysV init scripts will be directed to
81 the console. This switch has no effect when run as session
82 instance. Takes a boolean argument which may be omitted which is
83 interpreted as true.
84
85 --log-target=
86 Set log target. Argument must be one of console, syslog, kmsg,
87 syslog-or-kmsg, null.
88
89 --log-level=
90 Set log level. As argument this accepts a numerical log level or
91 the well-known syslog(3) symbolic names (lowercase): emerg, alert,
92 crit, err, warning, notice, info, debug.
93
94 --log-color=
95 Highlight important log messages. Argument is a boolean value. If
96 the argument is omitted it defaults to true.
97
98 --log-location=
99 Include code location in log messages. This is mostly relevant for
100 debugging purposes. Argument is a boolean value. If the argument is
101 omitted it defaults to true.
102
104 systemd provides a dependency system between various entities called
105 "units". Units encapsulate various objects that are relevant for system
106 boot-up and maintenance. The majority of units are configured in unit
107 configuration files, whose syntax and basic set of options is described
108 in systemd.unit(5), however some are created automatically from other
109 configuration or dynamically from system state. Units may be ´active´
110 (meaning started, bound, plugged in, ... depending on the unit type,
111 see below), or ´inactive´ (meaning stopped, unbound, unplugged, ...),
112 as well as in the process of being activated or deactivated, i.e.
113 between the two states (these states are called ´activating´,
114 ´deactivating´). A special ´failed´ state is available as well which is
115 very similar to ´inactive´ and is entered when the service failed in
116 some way (process returned error code on exit, or crashed, or an
117 operation timed out). If this state is entered the cause will be
118 logged, for later reference. Note that the various unit types may have
119 a number of additional substates, which are mapped to the five
120 generalized unit states described here.
121
122 The following unit types are available:
123
124 1. Service units, which control daemons and the processes they consist
125 of. For details see systemd.service(5).
126
127 2. Socket units, which encapsulate local IPC or network sockets in the
128 system, useful for socket-based activation. For details about
129 socket units see systemd.socket(5), for details on socket-based
130 activation and other forms of activation, see daemon(7).
131
132 3. Target units are useful to group units, or provide well-known
133 synchronization points during boot-up, see systemd.target(5).
134
135 4. Device units expose kernel devices in systemd and may be used to
136 implement device-based activation. For details see
137 systemd.device(5).
138
139 5. Mount units control mount points in the file system, for details
140 see systemd.mount(5).
141
142 6. Automount units provide automount capabilities, for on-demand
143 mounting of file systems as well as parallelized boot-up. See
144 systemd.automount(5).
145
146 7. Snapshot units can be used to temporarily save the state of the set
147 of systemd units, which later may be restored by activating the
148 saved snapshot unit. For more information see systemd.snapshot(5).
149
150 8. Timer units are useful for triggering activation of other units
151 based on timers. You may find details in systemd.timer(5).
152
153 9. Swap units are very similar to mount units and encapsulated memory
154 swap partitions or files of the operating systemd. They are
155 described in systemd.swap(5).
156
157 10. Path units may be used to activate other services when file system
158 objects change or are modified. See systemd.path(5).
159
160 Units are named as their configuration files. Some units have special
161 semantics. A detailed list you may find in systemd.special(7).
162
163 systemd knows various kinds of dependencies, including positive and
164 negative requirement dependencies (i.e. Requires= and Conflicts=) as
165 well as ordering dependencies (After= and Before=). NB: ordering and
166 requirement dependencies are orthogonal. If only a requirement
167 dependency exists between two units (e.g. foo.service requires
168 bar.service), but no ordering dependency (e.g. foo.service after
169 bar.service) and both are requested to start, they will be started in
170 parallel. It is a common pattern that both requirement and ordering
171 dependencies are placed between two units. Also note that the majority
172 of dependencies are implicitly created and maintained by systemd. In
173 most cases it should be unnecessary to declare additional dependencies
174 manually, however it is possible to do this.
175
176 Application programs and units (via dependencies) may requests state
177 changes of units. In systemd, these requests are encapsulated as ´jobs´
178 and maintained in a job queue. Jobs may succeed or can fail, their
179 execution is ordered based on the ordering dependencies of the units
180 they have been scheduled for.
181
182 On boot systemd activates the target unit default.target whose job is
183 to activate on-boot services and other on-boot units by pulling them in
184 via dependencies. Usually the unit name is just an alias (symlink) for
185 either graphical.target (for fully-featured boots into the UI) or
186 multi-user.target (for limited console-only boots for use in embedded
187 or server environments, or similar; a subset of graphical.target).
188 However it is at the discretion of the administrator to configure it as
189 an alias to any other target unit. See systemd.special(7) for details
190 about these target units.
191
192 Processes systemd spawns are placed in individual Linux control groups
193 named after the unit which they belong to in the private systemd
194 hierarchy. (see cgroups.txt[1] for more information about control
195 groups, or short "cgroups"). systemd uses this to effectively keep
196 track of processes. Control group information is maintained in the
197 kernel, and is accessible via the file system hierarchy (beneath
198 /sys/fs/cgroup/systemd/), or in tools such as ps(1) (ps xawf -eo
199 pid,user,cgroup,args is particularly useful to list all processes and
200 the systemd units they belong to.).
201
202 systemd is compatible with the SysV init system to a large degree: SysV
203 init scripts are supported and simply read as an alternative (though
204 limited) configuration file format. The SysV /dev/initctl interface is
205 provided, and compatibility implementations of the various SysV client
206 tools are available. In addition to that, various established Unix
207 functionality such as /etc/fstab or the utmp database are supported.
208
209 systemd has a minimal transaction system: if a unit is requested to
210 start up or shut down it will add it and all its dependencies to a
211 temporary transaction. Then, it will verify if the transaction is
212 consistent (i.e. whether the ordering of all units is cycle-free). If
213 it is not, systemd will try to fix it up, and removes non-essential
214 jobs from the transaction that might remove the loop. Also, systemd
215 tries to suppress non-essential jobs in the transaction that would stop
216 a running service. Finally it is checked whether the jobs of the
217 transaction contradict jobs that have already been queued, and
218 optionally the transaction is aborted then. If all worked out and the
219 transaction is consistent and minimized in its impact it is merged with
220 all already outstanding jobs and added to the run queue. Effectively
221 this means that before executing a requested operation, systemd will
222 verify that it makes sense, fixing it if possible, and only failing if
223 it really cannot work.
224
225 Systemd contains native implementations of various tasks that need to
226 be executed as part of the boot process. For example, it sets the host
227 name or configures the loopback network device. It also sets up and
228 mounts various API file systems, such as /sys or /proc.
229
230 For more information about the concepts and ideas behind systemd please
231 refer to the Original Design Document[2].
232
234 System unit directories
235 The systemd system manager reads unit configuration from various
236 directories. Packages that want to install unit files shall place
237 them in the directory returned by pkg-config systemd
238 --variable=systemdsystemunitdir. Other directories checked are
239 /usr/local/share/systemd/system and /usr/share/systemd/system. User
240 configuration always takes precedence. pkg-config systemd
241 --variable=systemdsystemconfdir returns the path of the system
242 configuration directory. Packages should alter the content of these
243 directories only with the enable and disable commands of the
244 systemctl(1) tool.
245
246 Session unit directories
247 Similar rules apply for the session unit directories. However, here
248 the XDG Base Directory specification[3] is followed to find units.
249 Applications should place their unit files in the directory
250 returned by pkg-config systemd --variable=systemdsessionunitdir.
251 Global configuration is done in the directory reported by
252 pkg-config systemd --variable=systemdsessionconfdir. The enable and
253 disable commands of the systemctl(1) tool can handle both global
254 (i.e. for all users) and private (for one user) enabling/disabling
255 of units.
256
257 SysV init scripts directory
258 The location of the SysV init script directory varies between
259 distributions. If systemd cannot find a native unit file for a
260 requested service, it will look for a SysV init script of the same
261 name (with the .service suffix removed).
262
263 SysV runlevel link farm directory
264 The location of the SysV runlevel link farm directory varies
265 between distributions. systemd will take the link farm into account
266 when figuring out whether a service shall be enabled. Note that a
267 service unit with a native unit configuration file cannot be
268 started by activating it in the SysV runlevel link farm.
269
271 SIGTERM
272 Upon receiving this signal the systemd system manager serializes
273 its state, reexecutes itself and deserializes the saved state
274 again. This is mostly equivalent to systemctl daemon-reexec.
275
276 systemd session managers will start the exit.target unit when this
277 signal is received. This is mostly equivalent to systemctl
278 --session start exit.target.
279
280 SIGINT
281 Upon receiving this signal the systemd system manager will start
282 the ctrl-alt-del.target unit. This is mostly equivalent to
283 systemctl start ctl-alt-del.target.
284
285 systemd session managers treat this signal the same way as SIGTERM.
286
287 SIGWINCH
288 When this signal is received the systemd system manager will start
289 the kbrequest.target unit. This is mostly equivalent to systemctl
290 start kbrequest.target.
291
292 This signal is ignored by systemd session managers.
293
294 SIGPWR
295 When this signal is received the systemd manager will start the
296 sigpwr.target unit. This is mostly equivalent to systemctl start
297 sigpwr.target.
298
299 SIGUSR1
300 When this signal is received the systemd manager will try to
301 reconnect to the D-Bus bus.
302
303 SIGUSR2
304 When this signal is received the systemd manager will log its
305 complete state in human readable form. The data logged is the same
306 as printed by systemctl dump.
307
308 SIGHUP
309 Reloads the complete daemon configuration. This is mostly
310 equivalent to systemctl daemon-reload.
311
312 SIGRTMIN+0
313 Enters default mode, starts the default.target unit. This is mostly
314 equivalent to systemctl start default.target.
315
316 SIGRTMIN+1
317 Enters rescue mode, starts the rescue.target unit. This is mostly
318 equivalent to systemctl isolate rescue.target.
319
320 SIGRTMIN+2
321 Enters emergency mode, starts the emergency.service unit. This is
322 mostly equivalent to systemctl isolate emergency.service.
323
324 SIGRTMIN+3
325 Halts the machine, starts the halt.target unit. This is mostly
326 equivalent to systemctl start halt.target.
327
328 SIGRTMIN+4
329 Powers off the machine, starts the poweroff.target unit. This is
330 mostly equivalent to systemctl start poweroff.target.
331
332 SIGRTMIN+5
333 Reboots the machine, starts the reboot.target unit. This is mostly
334 equivalent to systemctl start reboot.target.
335
337 $SYSTEMD_LOG_LEVEL
338 systemd reads the log level from this environment variable. This
339 can be overridden with --log-level=.
340
341 $SYSTEMD_LOG_TARGET
342 systemd reads the log target from this environment variable. This
343 can be overridden with --log-target=.
344
345 $SYSTEMD_LOG_COLOR
346 Controls whether systemd highlights important log messages. This
347 can be overridden with --log-color=.
348
349 $SYSTEMD_LOG_LOCATION
350 Controls whether systemd prints the code location along with log
351 messages. This can be overridden with --log-location=.
352
353 $XDG_CONFIG_HOME, $XDG_CONFIG_DIRS, $XDG_DATA_HOME, $XDG_DATA_DIRS
354 The systemd session manager uses these variables in accordance to
355 the XDG Base Directory specification[3] to find its configuration.
356
357 $SYSTEMD_UNIT_PATH
358 Controls where systemd looks for unit files.
359
360 $SYSTEMD_SYSVINIT_PATH
361 Controls where systemd looks for SysV init scripts.
362
363 $SYSTEMD_SYSVRCND_PATH
364 Controls where systemd looks for SysV init script runlevel link
365 farms.
366
367 $LISTEN_PID, $LISTEN_FDS
368 Set by systemd for supervised processes during socket-based
369 activation. See sd_listen_fds(3) for more information.
370
371 $NOTIFY_SOCKET
372 Set by systemd for supervised processes for status and start-up
373 completion notification. See sd_notify(3) for more information.
374
376 When run as system instance systemd parses a few kernel command line
377 arguments:
378
379 systemd.unit=
380 Overrides the unit to activate on boot. Defaults to default.target.
381 This may be used to temporarily boot into a different boot unit,
382 for example rescue.target or emergency.service. See
383 systemd.special(7) for details about these units.
384
385 systemd.dump_core=
386 Takes a boolean argument. If true systemd dumps core when it
387 crashes. Otherwise no core dump is created. Defaults to true.
388
389 systemd.crash_shell=
390 Takes a boolean argument. If true systemd spawns a shell when it
391 crashes. Otherwise no core dump is created. Defaults to false, for
392 security reasons, as the shell is not protected by any password
393 authentication.
394
395 systemd.crash_chvt=
396 Takes an integer argument. If positive systemd activates the
397 specified virtual terminal when it crashes. Defaults to -1.
398
399 systemd.confirm_spawn=
400 Takes a boolean argument. If true asks for confirmation when
401 spawning processes. Defaults to false.
402
403 systemd.show_status=
404 Takes a boolean argument. If true shows terse service status
405 updates on the console during bootup. Defaults to true.
406
407 systemd.sysv_console=
408 Takes a boolean argument. If true output of SysV init scripts will
409 be directed to the console. Defaults to true, unless quiet is
410 passed as kernel command line option in which case it defaults to
411 false.
412
413 systemd.log_target=, systemd.log_level=, systemd.log_color=,
414 systemd.log_location=
415 Controls log output, with the same effect as the
416 $SYSTEMD_LOG_TARGET, $SYSTEMD_LOG_LEVEL, $SYSTEMD_LOG_COLOR,
417 $SYSTEMD_LOG_LOCATION environment variables described above.
418
420 @/org/freedesktop/systemd1/notify
421 Daemon status notification socket. This is an AF_UNIX datagram
422 socket in the Linux abstract namespace, and is used to implement
423 the daemon notification logic as implemented by sd_notify(3).
424
425 @/org/freedesktop/systemd1/logger
426 Used internally by the systemd-logger.service unit to connect
427 STDOUT and/or STDERR of spawned processes to syslog(3) or the
428 kernel log buffer. This is an AF_UNIX stream socket in the Linux
429 abstract namespace.
430
431 @/org/freedesktop/systemd1/shutdown
432 Used internally by the shutdown(8) tool to implement delayed
433 shutdowns. This is an AF_UNIX datagram socket in the Linux abstract
434 namespace.
435
436 @/org/freedesktop/systemd1/private
437 Used internally as communication channel between systemctl(1) and
438 the systemd process. This is an AF_UNIX stream socket in the Linux
439 abstract namespace. This interface is private to systemd and should
440 not be used in external projects.
441
442 /dev/initctl
443 Limited compatibility support for the SysV client interface, as
444 implemented by the systemd-initctl.service unit. This is a named
445 pipe in the file system. This interface is obsolete and should not
446 be used in new applications.
447
449 systemctl(1), systemadm(1), systemd-notify(1), daemon(7), sd-daemon(7),
450 systemd.unit(5), systemd.special(5), pkg-config(1)
451
453 Lennart Poettering <lennart@poettering.net>
454 Developer
455
457 1. cgroups.txt
458 http://www.kernel.org/doc/Documentation/cgroups/cgroups.txt
459
460 2. Original Design Document
461 http://0pointer.de/blog/projects/systemd.html
462
463 3. XDG Base Directory specification
464 http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
465
466
467
468systemd 09/14/2010 SYSTEMD(1)