1 <?xml version='1.0'?> <!--*-nxml-*-->
2 <?xml-stylesheet type="text/xsl" href="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl"?>
3 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
4 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
7 This file is part of systemd.
9 Copyright 2010 Lennart Poettering
11 systemd is free software; you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by
13 the Free Software Foundation; either version 2 of the License, or
14 (at your option) any later version.
16 systemd is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with systemd; If not, see <http://www.gnu.org/licenses/>.
25 <refentry id="systemd.service">
27 <title>systemd.service</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.service</refentrytitle>
42 <manvolnum>5</manvolnum>
46 <refname>systemd.service</refname>
47 <refpurpose>systemd service configuration files</refpurpose>
51 <para><filename>systemd.service</filename></para>
55 <title>Description</title>
57 <para>A configuration file ending in .service encodes
58 information about a process controlled and supervised
61 <para>This man page lists the configuration options
62 specific to this unit type. See
63 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
64 for the common options of all unit configuration
69 <title>Options</title>
73 <term><varname>Type=</varname></term>
76 <literal>forking</literal>,
77 <literal>simple</literal>,
78 <literal>finish</literal>,
79 <literal>dbus</literal>.</para>
82 <literal>forking</literal>
83 (the default) it is expected
84 that the process configured
86 <varname>ExecStart=</varname>
87 will start up and call
88 <function>fork()</function>. The
89 parent process is expected to
90 finish when start-up is
91 complete and all communication
92 channels set up. The child
93 continues to run as the main
94 daemon process. This is the
95 behaviour of traditional UNIX
96 daemons. If this setting is
97 used it is recommended to also
99 <varname>PIDFile=</varname>
100 option, so that systemd can
101 identify the main process of
102 the daemon. systemd will start
103 follow-up units as soon as the
104 parent process exited.</para>
107 <literal>simple</literal> (the
108 recommended value) it is
109 expected that the process
111 <varname>ExecStart=</varname>
112 is the main process of the
114 communication channels must be
115 available before the daemon is
116 started up, as systemd will
117 immediately start follow-up
121 <literal>finish</literal> is
123 <literal>simple</literal>,
124 however it is expected that
125 the process has to exit before
126 systemd starts follow-up
127 units. <varname>ValidNoProcess=</varname>
128 is particularly useful for
129 this type of service.</para>
132 <literal>dbus</literal> is
134 <literal>simple</literal>,
135 however it is expected that
136 the daemon acquires a name on
137 the D-Bus bus, as configured
139 <varname>BusName=</varname>. Follow-up
140 units will be started after
146 <term><varname>ValidNoProcess=</varname></term>
148 <para>Takes a boolean value
149 that specifies whether the service
150 shall be considered active
151 even when all its processes
152 exited. Defaults to <literal>no</literal>.</para>
157 <term><varname>PIDFile=</varname></term>
159 <para>Takes an absolute file
160 name pointing to the PID file
161 of this daemon. Use of this
162 option is recommended for
164 <varname>Type=</varname> is
166 <literal>forking</literal>.</para>
171 <term><varname>BusName=</varname></term>
173 <para>Takes a D-Bus bus name
174 that this service is reachable
175 as. This option is mandatory
177 <varname>Type=</varname> is
179 <literal>dbus</literal>, but
181 recommended as well if the
182 process takes a name on the
188 <term><varname>ExecStart=</varname></term>
190 <para>Takes a command line
191 that is executed when this
192 service shall be started
193 up. The first word of the
194 command line must be an
195 absolute file name. It is
196 mandatory to set this option
197 for all services.</para>
205 <title>See Also</title>
207 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
208 <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>8</manvolnum></citerefentry>
209 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>