chiark / gitweb /
1e26310c4f80c7bf8e1a6e0426e46dc55fd727f5
[elogind.git] / man / systemd-install.xml
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">
4
5 <!--
6   This file is part of systemd.
7
8   Copyright 2010 Lennart Poettering
9
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.
14
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.
19
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/>.
22 -->
23
24 <refentry id="systemd-install">
25
26         <refentryinfo>
27                 <title>systemd-install</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-install</refentrytitle>
42                 <manvolnum>1</manvolnum>
43         </refmeta>
44
45         <refnamediv>
46                 <refname>systemd-install</refname>
47                 <refpurpose>Enable or disable a systemd unit
48                 definition file</refpurpose>
49         </refnamediv>
50
51         <refsynopsisdiv>
52                 <cmdsynopsis>
53                         <command>systemd-install <arg choice="opt" rep="repeat">OPTIONS</arg> <arg choice="plain">enable</arg> <arg choice="opt" rep="repeat">NAME</arg></command>
54                 </cmdsynopsis>
55                 <cmdsynopsis>
56                         <command>systemd-install <arg choice="opt" rep="repeat">OPTIONS</arg> <arg choice="plain">disable</arg> <arg choice="opt" rep="repeat">NAME</arg></command>
57                 </cmdsynopsis>
58                 <cmdsynopsis>
59                         <command>systemd-install <arg choice="opt" rep="repeat">OPTIONS</arg> <arg choice="plain">realize</arg> <arg choice="opt" rep="repeat">NAME</arg></command>
60                 </cmdsynopsis>
61                 <cmdsynopsis>
62                         <command>systemd-install <arg choice="opt" rep="repeat">OPTIONS</arg> <arg choice="plain">test</arg> <arg choice="opt" rep="repeat">NAME</arg></command>
63                 </cmdsynopsis>
64         </refsynopsisdiv>
65
66         <refsect1>
67                 <title>Description</title>
68
69                 <para><command>systemd-install</command> enables or
70                 disables systemd units, or checks whether they are
71                 enabled.</para>
72
73                 <para>This command is useful to apply or undo the
74                 installation instructions encoded in the <literal>[Install]</literal>
75                 section of unit files. See
76                 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
77                 for more information.</para>
78
79                 <para>Enabling units (as with <command>systemd-install
80                 enable</command>) should not be confused with
81                 activating units (as with <command>systemctl
82                 start</command>). The former simply installs the unit
83                 files in the configuration tree, but does not start
84                 them. The latter equals starting them, but does not
85                 necessarily require them to be enabled.</para>
86         </refsect1>
87
88         <refsect1>
89                 <title>Options</title>
90
91                 <para>The following options are understood:</para>
92
93                 <variablelist>
94                         <varlistentry>
95                                 <term><option>--help</option></term>
96
97                                 <listitem><para>Prints a short help
98                                 text and exits.</para></listitem>
99                         </varlistentry>
100
101                         <varlistentry>
102                                 <term><option>--force</option></term>
103
104                                 <listitem><para>Enable/disable a
105                                 service even if it conflicts
106                                 with/contradicts another service. This
107                                 might have the effect of disabling
108                                 another service that was
109                                 enabled.</para></listitem>
110                         </varlistentry>
111
112                         <varlistentry>
113                                 <term><option>--system</option></term>
114
115                                 <listitem><para>Enable/disable a
116                                 system service.</para></listitem>
117                         </varlistentry>
118
119                         <varlistentry>
120                                 <term><option>--session</option></term>
121
122                                 <listitem><para>Enable/disable a
123                                 session service for the calling
124                                 user.</para></listitem>
125                         </varlistentry>
126
127                         <varlistentry>
128                                 <term><option>--global</option></term>
129
130                                 <listitem><para>Enable/disable a
131                                 session service for all
132                                 users.</para></listitem>
133                         </varlistentry>
134
135                         <varlistentry>
136                                 <term><option>--realize[=MODE]</option></term>
137
138                                 <listitem><para>After
139                                 enabling/disabling stop/restart/stop
140                                 the unit and reload manager
141                                 configuration. Optionally, takes one
142                                 of <option>no</option>,
143                                 <option>reload</option>,
144                                 <option>minimal</option>,
145                                 <option>maybe</option> or
146                                 <option>yes</option>. If
147                                 <option>no</option> is passed the
148                                 manager will not reload its
149                                 configuration and no service will be
150                                 started or stopped after
151                                 enabling/disabling of the unit
152                                 files. If <option>reload</option> is
153                                 passed the daemon configuration is
154                                 reloaded but the unit otherwise not
155                                 started/stopped/restarted. If
156                                 <option>minimal</option> is passed and
157                                 a unit is being enabled it will also
158                                 be restarted should it already be
159                                 running. If a unit is being disabled
160                                 it will be stopped should it be
161                                 running. In either case the daemon
162                                 configuration is
163                                 reloaded. <option>maybe</option> is
164                                 similar to this, but the unit will
165                                 also be started if it is being enabled
166                                 and any of the units listed in
167                                 <varname>WantedBy=</varname> in the
168                                 <literal>[Install]</literal> section
169                                 of the unit file is already
170                                 activated. Finally
171                                 <option>yes</option> starts the unit
172                                 unconditionally after enabling. This
173                                 setting defaults to
174                                 <option>no</option>. If
175                                 <option>--realize</option> is
176                                 specifieed but the mode value is
177                                 omitted defaults to
178                                 <option>maybe</option>. This option
179                                 has no effect when
180                                 <option>--global</option> or
181                                 <command>test</command> is used, or
182                                 when systemd is not running or the
183                                 command is executed in a
184                                 <citerefentry><refentrytitle>chroot</refentrytitle><manvolnum>2</manvolnum></citerefentry>
185                                 environment. This option is implied if
186                                 the <command>realize</command> command
187                                 is used.</para></listitem>
188                         </varlistentry>
189                 </variablelist>
190
191                 <para>The following commands are understood:</para>
192
193                 <variablelist>
194                         <varlistentry>
195                                 <term><command>enable</command></term>
196
197                                 <listitem><para>Enable one or more
198                                 units. This will create a number of
199                                 symlinks as encoded in the
200                                 <literal>[Install]</literal> section
201                                 of a unit file.</para></listitem>
202                         </varlistentry>
203
204                         <varlistentry>
205                                 <term><command>disable</command></term>
206
207                                 <listitem><para>Disable or more
208                                 units. This will remove a number of
209                                 symlinks as encoded in the
210                                 <literal>[Install]</literal> section
211                                 of a unit file.</para></listitem>
212                         </varlistentry>
213
214                         <varlistentry>
215                                 <term><command>realize</command></term>
216
217                                 <listitem><para>Does not enable or
218                                 disable any unit. Checks whether any
219                                 of the units specified are enabled,
220                                 and then starts/stops/restarts the
221                                 units accordingly. This will check for
222                                 the existence of a number of symlinks
223                                 as encoded in the
224                                 <literal>[Install]</literal> section
225                                 of a unit file, and then executes the
226                                 action normally specified by
227                                 <option>--realize</option>. If
228                                 <option>--realize</option> is not
229                                 specified implies
230                                 <option>maybe</option> mode. To
231                                 override this mode specify
232                                 <option>--realize=</option> in
233                                 addition to
234                                 <command>realize</command>.</para></listitem>
235                         </varlistentry>
236
237                         <varlistentry>
238                                 <term><command>test</command></term>
239
240                                 <listitem><para>Does not enable or
241                                 disable any unit. Checks whether any
242                                 of the units specified are
243                                 enabled. This will check for the
244                                 existence of a number of symlinks as
245                                 encoded in the
246                                 <literal>[Install]</literal> section
247                                 of a unit file, and return with an
248                                 exit code of 0 if a unit is enabled, 1
249                                 otherwise.</para></listitem>
250                         </varlistentry>
251
252                 </variablelist>
253
254         </refsect1>
255
256         <refsect1>
257                 <title>Exit status</title>
258
259                 <para>On success 0 is returned, a non-zero failure
260                 code otherwise.</para>
261         </refsect1>
262
263         <refsect1>
264                 <title>See Also</title>
265                 <para>
266                         <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
267                         <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
268                         <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
269                 </para>
270         </refsect1>
271
272 </refentry>