chiark / gitweb /
socket: enforce limit on number of concurrent connections
[elogind.git] / man / systemd.service.xml
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">
5
6 <!--
7   This file is part of systemd.
8
9   Copyright 2010 Lennart Poettering
10
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.
15
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.
20
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/>.
23 -->
24
25 <refentry id="systemd.service">
26         <refentryinfo>
27                 <title>systemd.service</title>
28                 <productname>systemd</productname>
29
30                 <authorgroup>
31                         <author>
32                                 <contrib>Developer</contrib>
33                                 <firstname>Lennart</firstname>
34                                 <surname>Poettering</surname>
35                                 <email>lennart@poettering.net</email>
36                         </author>
37                 </authorgroup>
38         </refentryinfo>
39
40         <refmeta>
41                 <refentrytitle>systemd.service</refentrytitle>
42                 <manvolnum>5</manvolnum>
43         </refmeta>
44
45         <refnamediv>
46                 <refname>systemd.service</refname>
47                 <refpurpose>systemd service configuration files</refpurpose>
48         </refnamediv>
49
50         <refsynopsisdiv>
51                 <para><filename>systemd.service</filename></para>
52         </refsynopsisdiv>
53
54         <refsect1>
55                 <title>Description</title>
56
57                 <para>A configuration file ending in .service encodes
58                 information about a process controlled and supervised
59                 by systemd.</para>
60
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
65                 files.</para>
66         </refsect1>
67
68         <refsect1>
69                 <title>Options</title>
70
71                 <variablelist>
72                         <varlistentry>
73                                 <term><varname>Type=</varname></term>
74                                 <listitem>
75                                         <para>One of
76                                         <literal>forking</literal>,
77                                         <literal>simple</literal>,
78                                         <literal>finish</literal>,
79                                         <literal>dbus</literal>.</para>
80
81                                         <para>If set to
82                                         <literal>forking</literal>
83                                         (the default) it is expected
84                                         that the process configured
85                                         with
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
98                                         use the
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>
105
106                                         <para>If set to
107                                         <literal>simple</literal> (the
108                                         recommended value) it is
109                                         expected that the process
110                                         configured with
111                                         <varname>ExecStart=</varname>
112                                         is the main process of the
113                                         daemon. In this mode
114                                         communication channels must be
115                                         available before the daemon is
116                                         started up, as systemd will
117                                         immediately start follow-up
118                                         units.</para>
119
120                                         <para>Behaviour of
121                                         <literal>finish</literal> is
122                                         similar to
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>
130
131                                         <para>Behaviour of
132                                         <literal>dbus</literal> is
133                                         similar to
134                                         <literal>simple</literal>,
135                                         however it is expected that
136                                         the daemon acquires a name on
137                                         the D-Bus bus, as configured
138                                         by
139                                         <varname>BusName=</varname>. Follow-up
140                                         units will be started after
141                                         the name has been
142                                         acquired.</para>
143                                 </listitem>
144                         </varlistentry>
145                         <varlistentry>
146                                 <term><varname>ValidNoProcess=</varname></term>
147                                 <listitem>
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>
153                                 </listitem>
154                         </varlistentry>
155
156                         <varlistentry>
157                                 <term><varname>PIDFile=</varname></term>
158                                 <listitem>
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
163                                         services where
164                                         <varname>Type=</varname> is
165                                         set to
166                                         <literal>forking</literal>.</para>
167                                 </listitem>
168                         </varlistentry>
169
170                         <varlistentry>
171                                 <term><varname>BusName=</varname></term>
172                                 <listitem>
173                                         <para>Takes a D-Bus bus name
174                                         that this service is reachable
175                                         as. This option is mandatory
176                                         for services where
177                                         <varname>Type=</varname> is
178                                         set to
179                                         <literal>dbus</literal>, but
180                                         its use is otherwise
181                                         recommended as well if the
182                                         process takes a name on the
183                                         D-Bus bus.</para>
184                                 </listitem>
185                         </varlistentry>
186
187                         <varlistentry>
188                                 <term><varname>ExecStart=</varname></term>
189                                 <listitem>
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>
198                                 </listitem>
199                         </varlistentry>
200
201                 </variablelist>
202         </refsect1>
203
204         <refsect1>
205                   <title>See Also</title>
206                   <para>
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>
210                   </para>
211         </refsect1>
212
213 </refentry>