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 <refpurpose>systemd System and Session Manager</refpurpose>
52 <command>systemd <arg choice="opt" rep="repeat">OPTIONS</arg></command>
55 <command>init <arg choice="opt" rep="repeat">OPTIONS</arg> <arg choice="req">COMMAND</arg></command>
60 <title>Description</title>
62 <para>systemd is a system and session manager for
63 Linux operating systems. When run as first process on
64 boot (as PID 1) it may act as init system that brings
65 up and maintains userspace.</para>
67 <para>For compatibility with SysV if systemd is called
68 as <command>init</command> and a PID that is not
69 1 it will execute <command>telinit</command> and pass
70 all command line arguments unmodified. That means
71 <command>init</command> and <command>telinit</command>
72 are mostly equivalent when invoked from normal login sessions. See
73 <citerefentry><refentrytitle>telinit</refentrytitle><manvolnum>8</manvolnum></citerefentry>
74 for more information.</para>
78 <title>Options</title>
80 <para>The following options are understood:</para>
84 <term><option>-h</option></term>
85 <term><option>--help</option></term>
87 <listitem><para>Prints a short help
88 text and exits.</para></listitem>
91 <term><option>--unit=</option></term>
93 <listitem><para>Set default unit to
94 activate on startup. If not specified
96 <filename>default.target</filename>.</para></listitem>
99 <term><option>--running-as=</option></term>
101 <listitem><para>Tell systemd to run in
102 a particular mode. Argument is one of
103 <option>system</option>,
104 <option>session</option>. Normally it
105 should not be necessary to pass this
106 option, as systemd automatically
107 detects the mode it is started
108 in. This call is hence of little use
110 debugging.</para></listitem>
113 <term><option>--test</option></term>
115 <listitem><para>Determine startup
116 sequence, dump it and exit. This is an
117 option useful for debugging
118 only.</para></listitem>
121 <term><option>--dump-configuration-items</option></term>
123 <listitem><para>Dump understood unit
124 configuration items. This outputs a
125 terse but complete list of
126 configuration items understood in unit
127 definition files.</para></listitem>
130 <term><option>--confirm-spawn</option></term>
132 <listitem><para>Ask for confirmation when spawning processes.</para></listitem>
135 <term><option>--introspect=</option></term>
137 <listitem><para>Extract D-Bus
138 interface introspection data. This is
139 mostly useful at build ot install time
140 to generate data suitable for the
142 repository. Optionally the interface
143 name for the introspection data may be
144 specified. If omitted the
145 introspection data for all interfaces
146 is dumped.</para></listitem>
149 <term><option>--log-level=</option></term>
151 <listitem><para>Set log level. As
152 argument this accepts a numerical log
153 level or the well-known <citerefentry><refentrytitle>syslog</refentrytitle><manvolnum>3</manvolnum></citerefentry>
154 symbolic names (lowercase):
155 <option>emerg</option>,
156 <option>alert</option>,
157 <option>crit</option>,
158 <option>err</option>,
159 <option>warning</option>,
160 <option>notice</option>,
161 <option>info</option>,
162 <option>debug</option>.</para></listitem>
165 <term><option>--log-target=</option></term>
167 <listitem><para>Set log
168 target. Argument must be one of
169 <option>console</option>,
170 <option>syslog</option>,
171 <option>kmsg</option>,
172 <option>syslog-or-kmsg</option>,
173 <option>null</option>.</para></listitem>
176 <term><option>--log-color=</option></term>
178 <listitem><para>Highlight important
179 log messages. Argument is a boolean
180 value. If the argument is omitted it
182 <option>true</option>.</para></listitem>
185 <term><option>--log-location=</option></term>
187 <listitem><para>Include code location
188 in log messages. This is mostly
189 relevant for debugging
190 purposes. Argument is a boolean
191 value. If the argument is omitted
193 <option>true</option>.</para></listitem>
199 <title>Directories</title>
203 <term>System unit directories</term>
205 <listitem><para>The systemd system
206 manager reads unit configuration from
207 various directories. Packages that
208 want to install unit files shall place
209 them in the directory returned by
210 <command>pkg-config systemd
211 --variable=systemdsystemunitdir</command>. Other
212 directories checked are
213 <filename>/usr/local/share/systemd/system</filename>
215 <filename>/usr/share/systemd/system</filename>. User
216 configuration always takes
217 precedence. <command>pkg-config
219 --variable=systemdsystemconfdir</command>
220 returns the path of the system
221 configuration directory. Packages
222 should alter this directory only with
224 <citerefentry><refentrytitle>systemd-install</refentrytitle><manvolnum>1</manvolnum></citerefentry>
225 tool.</para></listitem>
231 <term>Session unit directories</term>
233 <listitem><para>Similar rules apply
235 directories. However, here the <ulink
236 url="http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html">XDG
237 Base Directory specification</ulink>
239 units. Applications should place their
240 unit files in the directory returned
241 by <command>pkg-config systemd
242 --variable=systemdsessionunitdir</command>. Global
243 configuration is done in the
244 directory reported by
245 <command>pkg-config systemd
246 --variable=systemdsessionconfdir</command>. The
247 <citerefentry><refentrytitle>systemd-install</refentrytitle><manvolnum>1</manvolnum></citerefentry>
248 tool can handle both global (i.e. for
249 all users) and private (for one user)
250 enabling/disabling of
251 units.</para></listitem>
257 <term>SysV init scripts directory</term>
259 <listitem><para>The location of the
260 SysV init script directory varies
261 between distributions. If systemd
262 cannot find a native unit file for a
263 requested service it will look for a
264 SysV init script of the same name
266 <filename>.service</filename> suffix
267 removed).</para></listitem>
273 <term>SysV runlevel link farm directory</term>
275 <listitem><para>The location of the
276 SysV runlevel link farm directory
277 varies between distributions. systemd
278 will take the link farm into account
279 when figuring out whether a service
280 shall be enabled. Note that a service
281 unit with a native unit configuration
282 file can be started by activating it
283 in the SysV runlevel link
284 farm.</para></listitem>
290 <title>Signals</title>
296 <listitem><para>Upon receiving this
297 signal the systemd system manager
298 serializes its state, reexecutes
299 itself and deserializes the saved
300 state again. This is mostly equivalent
301 to <command>systemctl
302 daemon-reexec</command>.</para>
304 <para>systemd session managers will
306 <filename>exit.target</filename> unit
307 when this signal is received. This is
309 <command>systemctl --session start
310 exit.target</command>.</para></listitem>
316 <listitem><para>Upon receiving this
317 signal the systemd system manager will
319 <filename>ctrl-alt-del.target</filename> unit. This
320 is mostly equivalent to
321 <command>systemctl start
322 ctl-alt-del.target</command>.</para>
324 <para>systemd session managers
325 treat this signal the same way as
326 SIGTERM.</para></listitem>
330 <term>SIGWINCH</term>
332 <listitem><para>When this signal is
333 received the systemd system manager
335 <filename>kbrequest.target</filename>
336 unit. This is mostly equivalent to
337 <command>systemctl start
338 kbrequest.target</command>.</para>
340 <para>This signal is ignored by
342 managers.</para></listitem>
348 <listitem><para>When this signal is
349 received the systemd manager
351 <filename>sigpwr.target</filename>
352 unit. This is mostly equivalent to
353 <command>systemctl start
354 sigpwr.target</command>.</para></listitem>
360 <listitem><para>When this signal is
361 received the systemd manager will try
362 to reconnect to the D-Bus
363 bus.</para></listitem>
369 <listitem><para>When this signal is
370 received the systemd manager will log
371 its complete state in human readable
372 form. The data logged is the same as
373 printed by <command>systemctl
374 dump</command>.</para></listitem>
380 <listitem><para>Reloads the complete
381 daemon configuration. This is mostly
382 equivalent to <command>systemctl
383 daemon-reload</command>.</para></listitem>
387 <term>SIGRTMIN+0</term>
389 <listitem><para>Enters default mode, starts the
390 <filename>default.target</filename>
391 unit. This is mostly equivalent to
392 <command>systemctl start
393 default.target</command>.</para></listitem>
397 <term>SIGRTMIN+1</term>
399 <listitem><para>Enters rescue mode,
401 <filename>rescue.target</filename>
402 unit. This is mostly equivalent to
403 <command>systemctl isolate
404 rescue.target</command>.</para></listitem>
408 <term>SIGRTMIN+2</term>
410 <listitem><para>Enters emergency mode,
412 <filename>emergency.service</filename>
413 unit. This is mostly equivalent to
414 <command>systemctl isolate
415 emergency.service</command>.</para></listitem>
419 <term>SIGRTMIN+3</term>
421 <listitem><para>Halts the machine,
423 <filename>halt.target</filename>
424 unit. This is mostly equivalent to
425 <command>systemctl start
426 halt.target</command>.</para></listitem>
430 <term>SIGRTMIN+4</term>
432 <listitem><para>Powers off the machine,
434 <filename>poweroff.target</filename>
435 unit. This is mostly equivalent to
436 <command>systemctl start
437 poweroff.target</command>.</para></listitem>
441 <term>SIGRTMIN+5</term>
443 <listitem><para>Reboots the machine,
445 <filename>reboot.target</filename>
446 unit. This is mostly equivalent to
447 <command>systemctl start
448 reboot.target</command>.</para></listitem>
454 <title>Environment</title>
458 <term><varname>$SYSTEMD_LOG_LEVEL</varname></term>
459 <listitem><para>systemd reads the
460 log level from this environment
461 variable. This can be overriden with
462 <option>--log-level=</option>.</para></listitem>
466 <term><varname>$SYSTEMD_LOG_TARGET</varname></term>
467 <listitem><para>systemd reads the
468 log target from this environment
469 variable. This can be overriden with
470 <option>--log-target=</option>.</para></listitem>
474 <term><varname>$SYSTEMD_LOG_COLOR</varname></term>
475 <listitem><para>Controls whether
476 systemd highlights important log
477 messages. This can be overriden with
478 <option>--log-color=</option>.</para></listitem>
482 <term><varname>$SYSTEMD_LOG_LOCATION</varname></term>
483 <listitem><para>Controls whether
484 systemd prints the code location along
485 with log messages. This can be
487 <option>--log-location=</option>.</para></listitem>
491 <term><varname>$XDG_CONFIG_HOME</varname></term>
492 <term><varname>$XDG_CONFIG_DIRS</varname></term>
493 <term><varname>$XDG_DATA_HOME</varname></term>
494 <term><varname>$XDG_DATA_DIRS</varname></term>
496 <listitem><para>The systemd session
497 manager uses these variables in
498 accordance to the <ulink
499 url="http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html">XDG
500 Base Directory specification</ulink>
501 to find its configuration.</para></listitem>
505 <term><varname>$SYSTEMD_UNIT_PATH</varname></term>
507 <listitem><para>Controls where systemd
509 files.</para></listitem>
513 <term><varname>$SYSTEMD_SYSVINIT_PATH</varname></term>
515 <listitem><para>Controls where systemd
516 looks for SysV init scripts.</para></listitem>
520 <term><varname>$SYSTEMD_SYSVRCND_PATH</varname></term>
522 <listitem><para>Controls where systemd
523 looks for SysV init script runlevel link
524 farms.</para></listitem>
528 <term><varname>$LISTEN_PID</varname></term>
529 <term><varname>$LISTEN_FDS</varname></term>
531 <listitem><para>Set by systemd for
532 supervised processes during
533 socket-based activation. See
534 <citerefentry><refentrytitle>sd_listen_fds</refentrytitle><manvolnum>3</manvolnum></citerefentry>
535 for more information.
540 <term><varname>$NOTIFY_SOCKET</varname></term>
542 <listitem><para>Set by systemd for
543 supervised processes for status and
544 start-up completion notification. See
545 <citerefentry><refentrytitle>sd_notify</refentrytitle><manvolnum>3</manvolnum></citerefentry>
546 for more information.
553 <title>Sockets and FIFOs</title>
557 <term><filename>@/org/freedesktop/systemd1/notify</filename></term>
559 <listitem><para>Daemon status
560 notification socket. This is an AF_UNIX
561 datagram socket in the Linux abstract
562 namespace, and is used to implement
563 the daemon notification logic as
565 <citerefentry><refentrytitle>sd_notify</refentrytitle><manvolnum>3</manvolnum></citerefentry>.</para></listitem>
570 <term><filename>@/org/freedesktop/systemd1/logger</filename></term>
572 <listitem><para>Used internally by the
573 <filename>systemd-logger.service</filename>
574 unit to connect STDOUT and/or STDERR
575 of spawned processes to
576 <citerefentry><refentrytitle>syslog</refentrytitle><manvolnum>3</manvolnum></citerefentry>
577 or the kernel log buffer. This is an
578 AF_UNIX stream socket in the Linux
579 abstract namespace.</para></listitem>
583 <term><filename>@/org/freedesktop/systemd1/private</filename></term>
585 <listitem><para>Used internally as
586 communication channel between
587 <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>
588 and the systemd process. This is an
589 AF_UNIX stream socket in the Linux
590 abstract namespace. This interface is
591 private to systemd and should not be
593 projects.</para></listitem>
597 <term><filename>/dev/initctl</filename></term>
599 <listitem><para>Limited compatibility
600 support for the SysV client interface,
601 as implemented by the
602 <filename>systemd-initctl.service</filename>
603 unit. This is a named pipe in the file
604 system. This interface is obsolete and
605 should not be used in new
606 applications.</para></listitem>
612 <title>See Also</title>
614 <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
615 <citerefentry><refentrytitle>systemadm</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
616 <citerefentry><refentrytitle>systemd-install</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
617 <citerefentry><refentrytitle>systemd-notify</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
618 <citerefentry><refentrytitle>daemon</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
619 <citerefentry><refentrytitle>sd-daemon</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
620 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
621 <citerefentry><refentrytitle>systemd.special</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
622 <citerefentry><refentrytitle>pkg-config</refentrytitle><manvolnum>1</manvolnum></citerefentry>