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
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>
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>
89 <title>Options</title>
91 <para>The following options are understood:</para>
95 <term><option>--help</option></term>
97 <listitem><para>Prints a short help
98 text and exits.</para></listitem>
102 <term><option>--force</option></term>
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>
113 <term><option>--system</option></term>
115 <listitem><para>Enable/disable a
116 system service.</para></listitem>
120 <term><option>--session</option></term>
122 <listitem><para>Enable/disable a
123 session service for the calling
124 user.</para></listitem>
128 <term><option>--global</option></term>
130 <listitem><para>Enable/disable a
131 session service for all
132 users.</para></listitem>
136 <term><option>--realize[=MODE]</option></term>
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
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
171 <option>yes</option> starts the unit
172 unconditionally after enabling. This
174 <option>no</option>. If
175 <option>--realize</option> is
176 specifieed but the mode value is
178 <option>maybe</option>. This option
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>
191 <para>The following commands are understood:</para>
195 <term><command>enable</command></term>
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>
205 <term><command>disable</command></term>
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>
215 <term><command>realize</command></term>
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
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
230 <option>maybe</option> mode. To
231 override this mode specify
232 <option>--realize=</option> in
234 <command>realize</command>.</para></listitem>
238 <term><command>test</command></term>
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
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>
257 <title>Exit status</title>
259 <para>On success 0 is returned, a non-zero failure
260 code otherwise.</para>
264 <title>See Also</title>
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>