chiark / gitweb /
remove duplicated includes
[elogind.git] / man / systemd-inhibit.xml
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">
4
5 <!--
6   This file is part of systemd.
7
8   Copyright 2012 Lennart Poettering
9
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.
14
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.
19
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/>.
22 -->
23
24 <refentry id="systemd-inhibit"
25           xmlns:xi="http://www.w3.org/2001/XInclude">
26
27         <refentryinfo>
28                 <title>systemd-inhibit</title>
29                 <productname>systemd</productname>
30
31                 <authorgroup>
32                         <author>
33                                 <contrib>Developer</contrib>
34                                 <firstname>Lennart</firstname>
35                                 <surname>Poettering</surname>
36                                 <email>lennart@poettering.net</email>
37                         </author>
38                 </authorgroup>
39         </refentryinfo>
40
41         <refmeta>
42                 <refentrytitle>systemd-inhibit</refentrytitle>
43                 <manvolnum>1</manvolnum>
44         </refmeta>
45
46         <refnamediv>
47                 <refname>systemd-inhibit</refname>
48                 <refpurpose>Execute a program with an inhibition lock taken</refpurpose>
49         </refnamediv>
50
51         <refsynopsisdiv>
52                 <cmdsynopsis>
53                         <command>systemd-inhibit <arg choice="opt" rep="repeat">OPTIONS</arg> <arg>COMMAND</arg> <arg choice="opt" rep="repeat">ARGUMENTS</arg></command>
54                 </cmdsynopsis>
55                 <cmdsynopsis>
56                         <command>systemd-inhibit <arg choice="opt" rep="repeat">OPTIONS</arg> --list</command>
57                 </cmdsynopsis>
58         </refsynopsisdiv>
59
60         <refsect1>
61                 <title>Description</title>
62
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
67                 afterwards.</para>
68
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>
75
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>
79         </refsect1>
80
81         <refsect1>
82                 <title>Options</title>
83
84                 <para>The following options are understood:</para>
85
86                 <variablelist>
87                         <varlistentry>
88                                 <term><option>--what=</option></term>
89
90                                 <listitem><para>Takes a colon-separated
91                                 list of one or more
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>,
100                                 for inhibiting
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,
106                                 defaults to
107                                 <literal>idle:sleep:shutdown</literal>.</para></listitem>
108                         </varlistentry>
109
110                         <varlistentry>
111                                 <term><option>--who=</option></term>
112
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>
118                         </varlistentry>
119
120                         <varlistentry>
121                                 <term><option>--why=</option></term>
122
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>
127                         </varlistentry>
128
129                         <varlistentry>
130                                 <term><option>--mode=</option></term>
131
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
140                                 override it. If
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
146                                 may be specified in
147                                 <citerefentry><refentrytitle>logind.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>. Note
148                                 that <literal>delay</literal> is only
149                                 available for <literal>sleep</literal>
150                                 and
151                                 <literal>shutdown</literal>.</para></listitem>
152                         </varlistentry>
153
154                         <varlistentry>
155                                 <term><option>--list</option></term>
156
157                                 <listitem><para>Lists all active
158                                 inhibition locks instead of acquiring
159                                 one.</para></listitem>
160                         </varlistentry>
161
162                         <xi:include href="standard-options.xml" xpointer="help" />
163                         <xi:include href="standard-options.xml" xpointer="version" />
164                 </variablelist>
165
166         </refsect1>
167
168         <refsect1>
169                 <title>Exit status</title>
170
171                 <para>Returns the exit status of the executed program.</para>
172         </refsect1>
173
174         <refsect1>
175                 <title>Example</title>
176
177                 <programlisting># systemd-inhibit wodim foobar.iso</programlisting>
178
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
183                 doing so.</para>
184         </refsect1>
185
186         <refsect1>
187                 <title>See Also</title>
188                 <para>
189                         <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
190                         <citerefentry><refentrytitle>logind.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>
191                 </para>
192         </refsect1>
193
194 </refentry>