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-install">
27 <title>systemd-install</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-install</refentrytitle>
42 <manvolnum>1</manvolnum>
46 <refname>systemd-install</refname>
47 <refpurpose>Enable or disable a systemd unit
48 definition file</refpurpose>
53 <command>systemd-install <arg choice="opt" rep="repeat">OPTIONS</arg> <arg choice="plain">enable</arg> <arg choice="opt" rep="repeat">NAME</arg></command>
56 <command>systemd-install <arg choice="opt" rep="repeat">OPTIONS</arg> <arg choice="plain">disable</arg> <arg choice="opt" rep="repeat">NAME</arg></command>
59 <command>systemd-install <arg choice="opt" rep="repeat">OPTIONS</arg> <arg choice="plain">realize</arg> <arg choice="opt" rep="repeat">NAME</arg></command>
62 <command>systemd-install <arg choice="opt" rep="repeat">OPTIONS</arg> <arg choice="plain">test</arg> <arg choice="opt" rep="repeat">NAME</arg></command>
67 <title>Description</title>
69 <para><command>systemd-install</command> enables or
70 disables systemd units, or checks whether they are
71 enabled, according to the installation suggestions
72 included in the unit files.</para>
74 <para>This command is useful to apply or undo the
75 installation instructions encoded in the <literal>[Install]</literal>
76 section of unit files. See
77 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
78 for more information.</para>
80 <para>Enabling units (as with <command>systemd-install
81 enable</command>) should not be confused with
82 activating units (as with <command>systemctl
83 start</command>). The former simply installs the unit
84 files in the configuration tree, but does not start
85 them. The latter equals starting them, but does not
86 necessarily require them to be enabled.</para>
89 <command>systemd-install</command> is the recommended
90 tool to create or remove symlinks in the systemd
91 configuration directory the administrator can also
92 create links there manually, which is particularly
93 useful to use configurations that deviate from the
94 installation suggestions included in the unit
99 <title>Options</title>
101 <para>The following options are understood:</para>
105 <term><option>--help</option></term>
107 <listitem><para>Prints a short help
108 text and exits.</para></listitem>
112 <term><option>--force</option></term>
114 <listitem><para>Enable/disable a
115 service even if it conflicts
116 with/contradicts another service. This
117 might have the effect of disabling
118 another service that was
119 enabled.</para></listitem>
123 <term><option>--system</option></term>
125 <listitem><para>Enable/disable a
126 system service.</para></listitem>
130 <term><option>--session</option></term>
132 <listitem><para>Enable/disable a
133 session service for the calling
134 user.</para></listitem>
138 <term><option>--global</option></term>
140 <listitem><para>Enable/disable a
141 session service for all
142 users.</para></listitem>
146 <term><option>--realize[=MODE]</option></term>
148 <listitem><para>After
149 enabling/disabling stop/restart/stop
150 the unit and reload manager
151 configuration. Optionally, takes one
152 of <option>no</option>,
153 <option>reload</option>,
154 <option>minimal</option>,
155 <option>maybe</option> or
156 <option>yes</option>. If
157 <option>no</option> is passed the
158 manager will not reload its
159 configuration and no service will be
160 started or stopped after
161 enabling/disabling of the unit
162 files. If <option>reload</option> is
163 passed the daemon configuration is
164 reloaded but the unit otherwise not
165 started/stopped/restarted. If
166 <option>minimal</option> is passed and
167 a unit is being enabled it will also
168 be restarted should it already be
169 running. If a unit is being disabled
170 it will be stopped should it be
171 running. In either case the daemon
173 reloaded. <option>maybe</option> is
174 similar to this, but the unit will
175 also be started if it is being enabled
176 and any of the units listed in
177 <varname>WantedBy=</varname> in the
178 <literal>[Install]</literal> section
179 of the unit file is already
181 <option>yes</option> starts the unit
182 unconditionally after enabling. This
184 <option>no</option>. If
185 <option>--realize</option> is
186 specifieed but the mode value is
188 <option>maybe</option>. This option
190 <option>--global</option> or
191 <command>test</command> is used, or
192 when systemd is not running or the
193 command is executed in a
194 <citerefentry><refentrytitle>chroot</refentrytitle><manvolnum>2</manvolnum></citerefentry>
195 environment. This option is implied if
196 the <command>realize</command> command
197 is used.</para></listitem>
201 <term><option>--all</option></term>
203 <listitem><para>If set makes sure that
204 all symlinks on the specified unit are
205 removed from the configuration
206 directory and its subdirectories, not
207 just those specified in the
208 <literal>[Install]</literal>
209 section.</para></listitem>
213 <term><option>--verbose</option></term>
214 <term><option>-v</option></term>
216 <listitem><para>Show what is done as
217 it is done.</para></listitem>
222 <para>The following commands are understood:</para>
226 <term><command>enable</command></term>
228 <listitem><para>Enable one or more
229 units. This will create a number of
230 symlinks as encoded in the
231 <literal>[Install]</literal> section
232 of a unit file.</para></listitem>
236 <term><command>disable</command></term>
238 <listitem><para>Disable or more
239 units. This will remove a number of
240 symlinks as encoded in the
241 <literal>[Install]</literal> section
242 of a unit file.</para></listitem>
246 <term><command>realize</command></term>
248 <listitem><para>Does not enable or
249 disable any unit. Checks whether any
250 of the units specified are enabled,
251 and then starts/stops/restarts the
252 units accordingly. This will check for
253 the existence of a number of symlinks
255 <literal>[Install]</literal> section
256 of a unit file, and then executes the
257 action normally specified by
258 <option>--realize</option>. If
259 <option>--realize</option> is not
261 <option>maybe</option> mode. To
262 override this mode specify
263 <option>--realize=</option> in
265 <command>realize</command>.</para></listitem>
269 <term><command>test</command></term>
271 <listitem><para>Does not enable or
272 disable any unit. Checks whether any
273 of the units specified are
274 enabled. This will check for the
275 existence of a number of symlinks as
277 <literal>[Install]</literal> section
278 of a unit file, and return with an
279 exit code of 0 if a unit is enabled, 1
280 otherwise.</para></listitem>
288 <title>Exit status</title>
290 <para>On success 0 is returned, a non-zero failure
291 code otherwise.</para>
295 <title>See Also</title>
297 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
298 <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
299 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>