chiark / gitweb /
update fixme
[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">test</arg> <arg choice="opt" rep="repeat">NAME</arg></command>
60                 </cmdsynopsis>
61         </refsynopsisdiv>
62
63         <refsect1>
64                 <title>Description</title>
65
66                 <para><command>systemd-install</command> enables or
67                 disables systemd units, or checks whether they are
68                 enabled.</para>
69
70                 <para>This command is useful to apply or undo the
71                 installation instructions encoded in the <literal>[Install]</literal>
72                 section of unit files. See
73                 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
74                 for more information.</para>
75
76                 <para>Enabling units (as with <command>systemd-install
77                 enable</command>) should not be confused with
78                 activating units (as with <command>systemctl
79                 start</command>). The former simply installs the unit
80                 files in the configuration tree, but does not start
81                 them. The latter equals starting them, but does not
82                 necessarily require them to be enabled.</para>
83         </refsect1>
84
85         <refsect1>
86                 <title>Options</title>
87
88                 <para>The following options are understood:</para>
89
90                 <variablelist>
91                         <varlistentry>
92                                 <term><option>--help</option></term>
93
94                                 <listitem><para>Prints a short help
95                                 text and exits.</para></listitem>
96                         </varlistentry>
97
98                         <varlistentry>
99                                 <term><option>--force</option></term>
100
101                                 <listitem><para>Enable/disable a
102                                 service even if it conflicts
103                                 with/contradicts another service. This
104                                 might have the effect of disabling
105                                 another service that was
106                                 enabled.</para></listitem>
107                         </varlistentry>
108
109                         <varlistentry>
110                                 <term><option>--system</option></term>
111
112                                 <listitem><para>Enable/disable a
113                                 system service.</para></listitem>
114                         </varlistentry>
115
116                         <varlistentry>
117                                 <term><option>--session</option></term>
118
119                                 <listitem><para>Enable/disable a
120                                 session service for the calling
121                                 user.</para></listitem>
122                         </varlistentry>
123
124                         <varlistentry>
125                                 <term><option>--global</option></term>
126
127                                 <listitem><para>Enable/disable a
128                                 session service for all
129                                 users.</para></listitem>
130                         </varlistentry>
131
132                         <varlistentry>
133                                 <term><option>--realize[=MODE]</option></term>
134
135                                 <listitem><para>After
136                                 enabling/disabling stop/restart/stop
137                                 the unit and reload manager
138                                 configuration. Optionally, takes one
139                                 of <option>no</option>,
140                                 <option>reload</option>,
141                                 <option>minimal</option>,
142                                 <option>maybe</option> or
143                                 <option>yes</option>. If
144                                 <option>no</option> is passed the
145                                 manager will not reload its
146                                 configuration and no service will be
147                                 started or stopped after
148                                 enabling/disabling of the unit
149                                 files. If <option>reload</option> is
150                                 passed the daemon configuration is
151                                 reloaded but the unit otherwise not
152                                 started/stopped/restarted. If
153                                 <option>minimal</option> is passed and
154                                 a unit is being enabled it will also
155                                 be restarted should it already be
156                                 running. If a unit is being disabled
157                                 it will be stopped should it be
158                                 running. In either case the daemon
159                                 configuration is
160                                 reloaded. <option>maybe</option> is
161                                 similar to this, but the unit will
162                                 also be started if it is being enabled
163                                 and any of the units listed in
164                                 <varname>WantedBy=</varname> in the
165                                 <literal>[Install]</literal> section
166                                 of the unit file is already
167                                 activated. Finally
168                                 <option>yes</option> starts the unit
169                                 unconditionally after enabling. This
170                                 setting defaults to
171                                 <option>no</option>. If the mode value
172                                 is omitted defaults to
173                                 <option>maybe</option>. This option
174                                 has no effect when
175                                 <option>--global</option> or
176                                 <command>test</command> is used, or
177                                 when systemd is not running or the
178                                 command is executed in a
179                                 <citerefentry><refentrytitle>chroot</refentrytitle><manvolnum>2</manvolnum></citerefentry>
180                                 environment.</para></listitem>
181                         </varlistentry>
182                 </variablelist>
183
184                 <para>The following commands are understood:</para>
185
186                 <variablelist>
187                         <varlistentry>
188                                 <term><command>enable</command></term>
189
190                                 <listitem><para>Enable a unit. This
191                                 will create a number of symlinks as
192                                 encoded in the
193                                 <literal>[Install]</literal> section
194                                 of a unit file.</para></listitem>
195                         </varlistentry>
196
197                         <varlistentry>
198                                 <term><command>disable</command></term>
199
200                                 <listitem><para>Disable a unit. This
201                                 will remove a number of symlinks as
202                                 encoded in the
203                                 <literal>[Install]</literal> section
204                                 of a unit file.</para></listitem>
205                         </varlistentry>
206
207                         <varlistentry>
208                                 <term><command>test</command></term>
209
210                                 <listitem><para>Checks whether any of
211                                 the units specified are
212                                 installed. This will check for the
213                                 existence of a number of symlinks as
214                                 encoded in the
215                                 <literal>[Install]</literal> section
216                                 of a unit file.</para></listitem>
217                         </varlistentry>
218                 </variablelist>
219
220         </refsect1>
221
222         <refsect1>
223                 <title>Exit status</title>
224
225                 <para>On success 0 is returned, a non-zero failure
226                 code otherwise.</para>
227         </refsect1>
228
229         <refsect1>
230                 <title>See Also</title>
231                 <para>
232                         <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
233                         <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
234                         <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
235                 </para>
236         </refsect1>
237
238 </refentry>