1 <?xml version='1.0'?> <!--*-nxml-*-->
2 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
6 This file is part of systemd.
8 Copyright 2010 Lennart Poettering
10 systemd is free software; you can redistribute it and/or modify it
11 under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 2 of the License, or
13 (at your option) any later version.
15 systemd is distributed in the hope that it will be useful, but
16 WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with systemd; If not, see <http://www.gnu.org/licenses/>.
24 <refentry id="systemd">
27 <title>systemd</title>
28 <productname>systemd</productname>
32 <contrib>Developer</contrib>
33 <firstname>Lennart</firstname>
34 <surname>Poettering</surname>
35 <email>lennart@poettering.net</email>
41 <refentrytitle>systemd</refentrytitle>
42 <manvolnum>1</manvolnum>
46 <refname>systemd</refname>
47 <refname>init</refname>
48 <refpurpose>systemd System and Session Manager</refpurpose>
53 <command>systemd <arg choice="opt" rep="repeat">OPTIONS</arg></command>
56 <command>init <arg choice="opt" rep="repeat">OPTIONS</arg> <arg choice="req">COMMAND</arg></command>
61 <title>Description</title>
63 <para>systemd is a system and session manager for
64 Linux operating systems. When run as first process on
65 boot (as PID 1), it acts as init system that brings
66 up and maintains userspace services.</para>
68 <para>For compatibility with SysV, if systemd is called
69 as <command>init</command> and a PID that is not
70 1, it will execute <command>telinit</command> and pass
71 all command line arguments unmodified. That means
72 <command>init</command> and <command>telinit</command>
73 are mostly equivalent when invoked from normal login sessions. See
74 <citerefentry><refentrytitle>telinit</refentrytitle><manvolnum>8</manvolnum></citerefentry>
75 for more information.</para>
79 <title>Options</title>
81 <para>The following options are understood:</para>
85 <term><option>-h</option></term>
86 <term><option>--help</option></term>
88 <listitem><para>Prints a short help
89 text and exits.</para></listitem>
92 <term><option>--unit=</option></term>
94 <listitem><para>Set default unit to
95 activate on startup. If not specified
97 <filename>default.target</filename>.</para></listitem>
100 <term><option>--running-as=</option></term>
102 <listitem><para>Tell systemd to run in
103 a particular mode. Argument is one of
104 <option>system</option>,
105 <option>session</option>. Normally it
106 should not be necessary to pass this
107 option, as systemd automatically
108 detects the mode it is started
109 in. This call is hence of little use
111 debugging.</para></listitem>
114 <term><option>--test</option></term>
116 <listitem><para>Determine startup
117 sequence, dump it and exit. This is an
118 option useful for debugging
119 only.</para></listitem>
122 <term><option>--dump-configuration-items</option></term>
124 <listitem><para>Dump understood unit
125 configuration items. This outputs a
126 terse but complete list of
127 configuration items understood in unit
128 definition files.</para></listitem>
131 <term><option>--confirm-spawn</option></term>
133 <listitem><para>Ask for confirmation when spawning processes.</para></listitem>
136 <term><option>--introspect=</option></term>
138 <listitem><para>Extract D-Bus
139 interface introspection data. This is
140 mostly useful at build at install time
141 to generate data suitable for the
143 repository. Optionally the interface
144 name for the introspection data may be
145 specified. If omitted, the
146 introspection data for all interfaces
147 is dumped.</para></listitem>
150 <term><option>--log-level=</option></term>
152 <listitem><para>Set log level. As
153 argument this accepts a numerical log
154 level or the well-known <citerefentry><refentrytitle>syslog</refentrytitle><manvolnum>3</manvolnum></citerefentry>
155 symbolic names (lowercase):
156 <option>emerg</option>,
157 <option>alert</option>,
158 <option>crit</option>,
159 <option>err</option>,
160 <option>warning</option>,
161 <option>notice</option>,
162 <option>info</option>,
163 <option>debug</option>.</para></listitem>
166 <term><option>--log-target=</option></term>
168 <listitem><para>Set log
169 target. Argument must be one of
170 <option>console</option>,
171 <option>syslog</option>,
172 <option>kmsg</option>,
173 <option>syslog-or-kmsg</option>,
174 <option>null</option>.</para></listitem>
177 <term><option>--log-color=</option></term>
179 <listitem><para>Highlight important
180 log messages. Argument is a boolean
181 value. If the argument is omitted it
183 <option>true</option>.</para></listitem>
186 <term><option>--log-location=</option></term>
188 <listitem><para>Include code location
189 in log messages. This is mostly
190 relevant for debugging
191 purposes. Argument is a boolean
192 value. If the argument is omitted
194 <option>true</option>.</para></listitem>
200 <title>Directories</title>
204 <term>System unit directories</term>
206 <listitem><para>The systemd system
207 manager reads unit configuration from
208 various directories. Packages that
209 want to install unit files shall place
210 them in the directory returned by
211 <command>pkg-config systemd
212 --variable=systemdsystemunitdir</command>. Other
213 directories checked are
214 <filename>/usr/local/share/systemd/system</filename>
216 <filename>/usr/share/systemd/system</filename>. User
217 configuration always takes
218 precedence. <command>pkg-config
220 --variable=systemdsystemconfdir</command>
221 returns the path of the system
222 configuration directory. Packages
223 should alter the content of these directories
225 <citerefentry><refentrytitle>systemd-install</refentrytitle><manvolnum>1</manvolnum></citerefentry>
226 tool.</para></listitem>
232 <term>Session unit directories</term>
234 <listitem><para>Similar rules apply
236 directories. However, here the <ulink
237 url="http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html">XDG
238 Base Directory specification</ulink>
240 units. Applications should place their
241 unit files in the directory returned
242 by <command>pkg-config systemd
243 --variable=systemdsessionunitdir</command>. Global
244 configuration is done in the
245 directory reported by
246 <command>pkg-config systemd
247 --variable=systemdsessionconfdir</command>. The
248 <citerefentry><refentrytitle>systemd-install</refentrytitle><manvolnum>1</manvolnum></citerefentry>
249 tool can handle both global (i.e. for
250 all users) and private (for one user)
251 enabling/disabling of
252 units.</para></listitem>
258 <term>SysV init scripts directory</term>
260 <listitem><para>The location of the
261 SysV init script directory varies
262 between distributions. If systemd
263 cannot find a native unit file for a
264 requested service, it will look for a
265 SysV init script of the same name
267 <filename>.service</filename> suffix
268 removed).</para></listitem>
274 <term>SysV runlevel link farm directory</term>
276 <listitem><para>The location of the
277 SysV runlevel link farm directory
278 varies between distributions. systemd
279 will take the link farm into account
280 when figuring out whether a service
281 shall be enabled. Note that a service
282 unit with a native unit configuration
283 file can be started by activating it
284 in the SysV runlevel link
285 farm.</para></listitem>
291 <title>Signals</title>
297 <listitem><para>Upon receiving this
298 signal the systemd system manager
299 serializes its state, reexecutes
300 itself and deserializes the saved
301 state again. This is mostly equivalent
302 to <command>systemctl
303 daemon-reexec</command>.</para>
305 <para>systemd session managers will
307 <filename>exit.target</filename> unit
308 when this signal is received. This is
310 <command>systemctl --session start
311 exit.target</command>.</para></listitem>
317 <listitem><para>Upon receiving this
318 signal the systemd system manager will
320 <filename>ctrl-alt-del.target</filename> unit. This
321 is mostly equivalent to
322 <command>systemctl start
323 ctl-alt-del.target</command>.</para>
325 <para>systemd session managers
326 treat this signal the same way as
327 SIGTERM.</para></listitem>
331 <term>SIGWINCH</term>
333 <listitem><para>When this signal is
334 received the systemd system manager
336 <filename>kbrequest.target</filename>
337 unit. This is mostly equivalent to
338 <command>systemctl start
339 kbrequest.target</command>.</para>
341 <para>This signal is ignored by
343 managers.</para></listitem>
349 <listitem><para>When this signal is
350 received the systemd manager
352 <filename>sigpwr.target</filename>
353 unit. This is mostly equivalent to
354 <command>systemctl start
355 sigpwr.target</command>.</para></listitem>
361 <listitem><para>When this signal is
362 received the systemd manager will try
363 to reconnect to the D-Bus
364 bus.</para></listitem>
370 <listitem><para>When this signal is
371 received the systemd manager will log
372 its complete state in human readable
373 form. The data logged is the same as
374 printed by <command>systemctl
375 dump</command>.</para></listitem>
381 <listitem><para>Reloads the complete
382 daemon configuration. This is mostly
383 equivalent to <command>systemctl
384 daemon-reload</command>.</para></listitem>
388 <term>SIGRTMIN+0</term>
390 <listitem><para>Enters default mode, starts the
391 <filename>default.target</filename>
392 unit. This is mostly equivalent to
393 <command>systemctl start
394 default.target</command>.</para></listitem>
398 <term>SIGRTMIN+1</term>
400 <listitem><para>Enters rescue mode,
402 <filename>rescue.target</filename>
403 unit. This is mostly equivalent to
404 <command>systemctl isolate
405 rescue.target</command>.</para></listitem>
409 <term>SIGRTMIN+2</term>
411 <listitem><para>Enters emergency mode,
413 <filename>emergency.service</filename>
414 unit. This is mostly equivalent to
415 <command>systemctl isolate
416 emergency.service</command>.</para></listitem>
420 <term>SIGRTMIN+3</term>
422 <listitem><para>Halts the machine,
424 <filename>halt.target</filename>
425 unit. This is mostly equivalent to
426 <command>systemctl start
427 halt.target</command>.</para></listitem>
431 <term>SIGRTMIN+4</term>
433 <listitem><para>Powers off the machine,
435 <filename>poweroff.target</filename>
436 unit. This is mostly equivalent to
437 <command>systemctl start
438 poweroff.target</command>.</para></listitem>
442 <term>SIGRTMIN+5</term>
444 <listitem><para>Reboots the machine,
446 <filename>reboot.target</filename>
447 unit. This is mostly equivalent to
448 <command>systemctl start
449 reboot.target</command>.</para></listitem>
455 <title>Environment</title>
459 <term><varname>$SYSTEMD_LOG_LEVEL</varname></term>
460 <listitem><para>systemd reads the
461 log level from this environment
462 variable. This can be overridden with
463 <option>--log-level=</option>.</para></listitem>
467 <term><varname>$SYSTEMD_LOG_TARGET</varname></term>
468 <listitem><para>systemd reads the
469 log target from this environment
470 variable. This can be overridden with
471 <option>--log-target=</option>.</para></listitem>
475 <term><varname>$SYSTEMD_LOG_COLOR</varname></term>
476 <listitem><para>Controls whether
477 systemd highlights important log
478 messages. This can be overridden with
479 <option>--log-color=</option>.</para></listitem>
483 <term><varname>$SYSTEMD_LOG_LOCATION</varname></term>
484 <listitem><para>Controls whether
485 systemd prints the code location along
486 with log messages. This can be
488 <option>--log-location=</option>.</para></listitem>
492 <term><varname>$XDG_CONFIG_HOME</varname></term>
493 <term><varname>$XDG_CONFIG_DIRS</varname></term>
494 <term><varname>$XDG_DATA_HOME</varname></term>
495 <term><varname>$XDG_DATA_DIRS</varname></term>
497 <listitem><para>The systemd session
498 manager uses these variables in
499 accordance to the <ulink
500 url="http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html">XDG
501 Base Directory specification</ulink>
502 to find its configuration.</para></listitem>
506 <term><varname>$SYSTEMD_UNIT_PATH</varname></term>
508 <listitem><para>Controls where systemd
510 files.</para></listitem>
514 <term><varname>$SYSTEMD_SYSVINIT_PATH</varname></term>
516 <listitem><para>Controls where systemd
517 looks for SysV init scripts.</para></listitem>
521 <term><varname>$SYSTEMD_SYSVRCND_PATH</varname></term>
523 <listitem><para>Controls where systemd
524 looks for SysV init script runlevel link
525 farms.</para></listitem>
529 <term><varname>$LISTEN_PID</varname></term>
530 <term><varname>$LISTEN_FDS</varname></term>
532 <listitem><para>Set by systemd for
533 supervised processes during
534 socket-based activation. See
535 <citerefentry><refentrytitle>sd_listen_fds</refentrytitle><manvolnum>3</manvolnum></citerefentry>
536 for more information.
541 <term><varname>$NOTIFY_SOCKET</varname></term>
543 <listitem><para>Set by systemd for
544 supervised processes for status and
545 start-up completion notification. See
546 <citerefentry><refentrytitle>sd_notify</refentrytitle><manvolnum>3</manvolnum></citerefentry>
547 for more information.
554 <title>Sockets and FIFOs</title>
558 <term><filename>@/org/freedesktop/systemd1/notify</filename></term>
560 <listitem><para>Daemon status
561 notification socket. This is an AF_UNIX
562 datagram socket in the Linux abstract
563 namespace, and is used to implement
564 the daemon notification logic as
566 <citerefentry><refentrytitle>sd_notify</refentrytitle><manvolnum>3</manvolnum></citerefentry>.</para></listitem>
571 <term><filename>@/org/freedesktop/systemd1/logger</filename></term>
573 <listitem><para>Used internally by the
574 <filename>systemd-logger.service</filename>
575 unit to connect STDOUT and/or STDERR
576 of spawned processes to
577 <citerefentry><refentrytitle>syslog</refentrytitle><manvolnum>3</manvolnum></citerefentry>
578 or the kernel log buffer. This is an
579 AF_UNIX stream socket in the Linux
580 abstract namespace.</para></listitem>
584 <term><filename>@/org/freedesktop/systemd1/private</filename></term>
586 <listitem><para>Used internally as
587 communication channel between
588 <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>
589 and the systemd process. This is an
590 AF_UNIX stream socket in the Linux
591 abstract namespace. This interface is
592 private to systemd and should not be
594 projects.</para></listitem>
598 <term><filename>/dev/initctl</filename></term>
600 <listitem><para>Limited compatibility
601 support for the SysV client interface,
602 as implemented by the
603 <filename>systemd-initctl.service</filename>
604 unit. This is a named pipe in the file
605 system. This interface is obsolete and
606 should not be used in new
607 applications.</para></listitem>
613 <title>See Also</title>
615 <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
616 <citerefentry><refentrytitle>systemadm</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
617 <citerefentry><refentrytitle>systemd-install</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
618 <citerefentry><refentrytitle>systemd-notify</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
619 <citerefentry><refentrytitle>daemon</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
620 <citerefentry><refentrytitle>sd-daemon</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
621 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
622 <citerefentry><refentrytitle>systemd.special</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
623 <citerefentry><refentrytitle>pkg-config</refentrytitle><manvolnum>1</manvolnum></citerefentry>