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"
25 xmlns:xi="http://www.w3.org/2001/XInclude">
28 <title>systemd-inhibit</title>
29 <productname>systemd</productname>
33 <contrib>Developer</contrib>
34 <firstname>Lennart</firstname>
35 <surname>Poettering</surname>
36 <email>lennart@poettering.net</email>
42 <refentrytitle>systemd-inhibit</refentrytitle>
43 <manvolnum>1</manvolnum>
47 <refname>systemd-inhibit</refname>
48 <refpurpose>Execute a program with an inhibition lock taken</refpurpose>
53 <command>systemd-inhibit <arg choice="opt" rep="repeat">OPTIONS</arg> <arg>COMMAND</arg> <arg choice="opt" rep="repeat">ARGUMENTS</arg></command>
56 <command>systemd-inhibit <arg choice="opt" rep="repeat">OPTIONS</arg> --list</command>
61 <title>Description</title>
63 <para><command>systemd-inhibit</command> may be used
64 to execute a program with a shutdown, sleep or idle
65 inhibitor lock taken. The lock will be acquired before
66 the specified command line is executed and released
69 <para>Inhibitor locks may be used to block or delay
70 system sleep and shutdown requests from the user, as well
71 as automatic idle handling of the OS. This is useful
72 to avoid system suspends while an optical disc is
73 being recorded, or similar operations that should not
74 be interrupted.</para>
76 <para>For more information see the <ulink
77 url="http://www.freedesktop.org/wiki/Software/systemd/inhibit">Inhibitor
78 Lock Developer Documentation</ulink>.</para>
82 <title>Options</title>
84 <para>The following options are understood:</para>
88 <term><option>--what=</option></term>
90 <listitem><para>Takes a colon-separated
92 operations to inhibit:
93 <literal>shutdown</literal>,
94 <literal>sleep</literal>,
95 <literal>idle</literal>,
96 <literal>handle-power-key</literal>,
97 <literal>handle-suspend-key</literal>,
98 <literal>handle-hibernate-key</literal>,
99 <literal>handle-lid-switch</literal>,
101 reboot/power-off/halt/kexec,
102 suspending/hibernating, the automatic
103 idle detection, or the low-level
104 handling of the power/sleep key and
105 the lid switch, respectively. If omitted,
107 <literal>idle:sleep:shutdown</literal>.</para></listitem>
111 <term><option>--who=</option></term>
113 <listitem><para>Takes a short,
114 human-readable descriptive string for the
115 program taking the lock. If not passed,
116 defaults to the command line
117 string.</para></listitem>
121 <term><option>--why=</option></term>
123 <listitem><para>Takes a short,
124 human-readable descriptive string for the
125 reason for taking the lock. Defaults
126 to "Unknown reason".</para></listitem>
130 <term><option>--mode=</option></term>
132 <listitem><para>Takes either
133 <literal>block</literal> or
134 <literal>delay</literal> and describes
135 how the lock is applied. If
136 <literal>block</literal> is used (the
137 default), the lock prohibits any of
138 the requested operations without time
139 limit, and only privileged users may
141 <literal>delay</literal> is used, the
142 lock can only delay the requested
143 operations for a limited time. If the
144 time elapses, the lock is ignored and
145 the operation executed. The time limit
147 <citerefentry><refentrytitle>logind.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>. Note
148 that <literal>delay</literal> is only
149 available for <literal>sleep</literal>
151 <literal>shutdown</literal>.</para></listitem>
155 <term><option>--list</option></term>
157 <listitem><para>Lists all active
158 inhibition locks instead of acquiring
159 one.</para></listitem>
162 <xi:include href="standard-options.xml" xpointer="help" />
163 <xi:include href="standard-options.xml" xpointer="version" />
169 <title>Exit status</title>
171 <para>Returns the exit status of the executed program.</para>
175 <title>Example</title>
177 <programlisting># systemd-inhibit wodim foobar.iso</programlisting>
179 <para>This burns the ISO image
180 <filename>foobar.iso</filename> on a CD using
181 <citerefentry project='man-pages'><refentrytitle>wodim</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
182 and inhibits system sleeping, shutdown and idle while
187 <title>See Also</title>
189 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
190 <citerefentry><refentrytitle>logind.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>