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 2012 Lennart Poettering
10 systemd is free software; you can redistribute it and/or modify it
11 under the terms of the GNU Lesser General Public License as published by
12 the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
20 You should have received a copy of the GNU Lesser General Public License
21 along with systemd; If not, see <http://www.gnu.org/licenses/>.
24 <refentry id="systemd-inhibit">
27 <title>systemd-inhibit</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-inhibit</refentrytitle>
42 <manvolnum>1</manvolnum>
46 <refname>systemd-inhibit</refname>
47 <refpurpose>Execute a program with an inhibition lock taken</refpurpose>
52 <command>systemd-inhibit <arg choice="opt" rep="repeat">OPTIONS</arg> <arg>COMMAND</arg> <arg choice="opt" rep="repeat">ARGUMENTS</arg></command>
55 <command>systemd-inhibit <arg choice="opt" rep="repeat">OPTIONS</arg> --list</command>
60 <title>Description</title>
62 <para><command>systemd-inhibit</command> may be used
63 to execute a program with a shutdown, sleep or idle
64 inhibitor lock taken. The lock will be acquired before
65 the specified command line is executed and released
68 <para>Inhibitor locks may be used to block or delay
69 system sleep and shutdown requests from the user, as well
70 as automatic idle handling of the OS. This is useful
71 to avoid system suspends while an optical disc is
72 being recorded, or similar operations that should not
73 be interrupted.</para>
75 <para>For more information see the <ulink
76 url="http://www.freedesktop.org/wiki/Software/systemd/inhibit">Inhibitor
77 Lock Developer Documentation</ulink>.</para>
81 <title>Options</title>
83 <para>The following options are understood:</para>
87 <term><option>-h</option></term>
88 <term><option>--help</option></term>
90 <listitem><para>Prints a short help
91 text and exits.</para></listitem>
95 <term><option>--version</option></term>
97 <listitem><para>Prints a short version
98 string and exits.</para></listitem>
102 <term><option>--what=</option></term>
104 <listitem><para>Takes a colon
105 separated list of one or more
106 operations to inhibit:
107 <literal>shutdown</literal>,
108 <literal>sleep</literal>,
109 <literal>idle</literal>,
110 <literal>handle-power-key</literal>,
111 <literal>handle-suspend-key</literal>,
112 <literal>handle-hibernate-key</literal>,
113 <literal>handle-lid-switch</literal>,
115 reboot/power-off/halt/kexec,
116 suspending/hibernating, the automatic
117 idle detection, or the low-level
118 handling of the power/sleep key and
119 the lid switch, respectively. If omitted,
121 <literal>idle:sleep:shutdown</literal>.</para></listitem>
125 <term><option>--who=</option></term>
127 <listitem><para>Takes a short human
128 readable descriptive string for the
129 program taking the lock. If not passed
130 defaults to the command line
131 string.</para></listitem>
135 <term><option>--why=</option></term>
137 <listitem><para>Takes a short human
138 readable descriptive string for the
139 reason for taking the lock. Defaults
140 to "Unknown reason".</para></listitem>
144 <term><option>--mode=</option></term>
146 <listitem><para>Takes either
147 <literal>block</literal> or
148 <literal>delay</literal> and describes
149 how the lock is applied. If
150 <literal>block</literal> is used (the
151 default), the lock prohibits any of
152 the requested operations without time
153 limit, and only privileged users may
155 <literal>delay</literal> is used, the
156 lock can only delay the requested
157 operations for a limited time. If the
158 time elapses the lock is ignored and
159 the operation executed. The time limit
161 <citerefentry><refentrytitle>systemd-logind.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>. Note
162 that <literal>delay</literal> is only
163 available for <literal>sleep</literal>
165 <literal>shutdown</literal>.</para></listitem>
169 <term><option>--list</option></term>
171 <listitem><para>Lists all active
172 inhibition locks instead of acquiring
173 one.</para></listitem>
180 <title>Exit status</title>
182 <para>Returns the exit status of the executed program.</para>
186 <title>Example</title>
188 <programlisting># systemd-inhibit wodim foobar.iso</programlisting>
190 <para>This burns the ISO image
191 <filename>foobar.iso</filename> on a CD using
192 <citerefentry><refentrytitle>wodim</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
193 and inhibits system sleeping, shutdown and idle while
198 <title>See Also</title>
200 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
201 <citerefentry><refentrytitle>systemd-logind.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>