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">test</arg> <arg choice="opt" rep="repeat">NAME</arg></command>
64 <title>Description</title>
66 <para><command>systemd-install</command> enables or
67 disables systemd units, or checks whether they are
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>
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>
86 <title>Options</title>
88 <para>The following options are understood:</para>
92 <term><option>--help</option></term>
94 <listitem><para>Prints a short help
95 text and exits.</para></listitem>
99 <term><option>--force</option></term>
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>
110 <term><option>--system</option></term>
112 <listitem><para>Enable/disable a
113 system service.</para></listitem>
117 <term><option>--session</option></term>
119 <listitem><para>Enable/disable a
120 session service for the calling
121 user.</para></listitem>
125 <term><option>--global</option></term>
127 <listitem><para>Enable/disable a
128 session service for all
129 users.</para></listitem>
133 <term><option>--start[=MODE]</option></term>
135 <listitem><para>After
136 enabling/disabling stop/restart the
137 unit and reload manager
138 configuration. Optionally, takes one
139 of <option>no</option>,
140 <option>minimal</option>,
141 <option>maybe</option> or
142 <option>yes</option>. If
143 <option>no</option> is passed the
144 manager will not reload its
145 configuration and no service will be
146 started or stopped after
147 enabling/disabling of the unit
148 files. If <option>minimal</option> is
149 passed and a unit is being enabled it
150 will also be restarted should it
151 already be running. If a unit is being
152 disabled it will be stopped should it
153 be running. In either case the
154 daemon configuration is
155 reloaded. <option>maybe</option> is
156 similar to this, but the unit will
157 also be started if it is being enabled
158 and any of the units listed in
159 <varname>WantedBy=</varname> in the
160 <literal>[Install]</literal> section
161 of the unit file is already
163 <option>yes</option> starts the unit
164 unconditionally after enabling. This
166 <option>no</option>. If the mode value
167 is omitted defaults to
168 <option>maybe</option>. This option
170 <option>--global</option> or
171 <command>test</command> is
172 used.</para></listitem>
176 <para>The following commands are understood:</para>
180 <term><command>enable</command></term>
182 <listitem><para>Enable a unit. This
183 will create a number of symlinks as
185 <literal>[Install]</literal> section
186 of a unit file.</para></listitem>
190 <term><command>disable</command></term>
192 <listitem><para>Disable a unit. This
193 will remove a number of symlinks as
195 <literal>[Install]</literal> section
196 of a unit file.</para></listitem>
200 <term><command>test</command></term>
202 <listitem><para>Checks whether any of
203 the units specified are
204 installed. This will check for the
205 existence of a number of symlinks as
207 <literal>[Install]</literal> section
208 of a unit file.</para></listitem>
215 <title>Exit status</title>
217 <para>On success 0 is returned, a non-zero failure
218 code otherwise.</para>
222 <title>See Also</title>
224 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
225 <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
226 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>