]>
Commit | Line | Data |
---|---|---|
eecd1362 LP |
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 | ||
dfdebb1b ZJS |
24 | <refentry id="systemd-inhibit" |
25 | xmlns:xi="http://www.w3.org/2001/XInclude"> | |
eecd1362 LP |
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 | |
4943c1c9 | 64 | to execute a program with a shutdown, sleep or idle |
eecd1362 LP |
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 | |
4943c1c9 LP |
70 | system sleep and shutdown requests from the user, as well |
71 | as automatic idle handling of the OS. This is useful | |
eecd1362 LP |
72 | to avoid system suspends while an optical disc is |
73 | being recorded, or similar operations that should not | |
74 | be interrupted.</para> | |
5b6a2c5a LP |
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> | |
eecd1362 LP |
79 | </refsect1> |
80 | ||
81 | <refsect1> | |
82 | <title>Options</title> | |
83 | ||
84 | <para>The following options are understood:</para> | |
85 | ||
86 | <variablelist> | |
eecd1362 LP |
87 | <varlistentry> |
88 | <term><option>--what=</option></term> | |
89 | ||
e9dd9f95 JSJ |
90 | <listitem><para>Takes a colon-separated |
91 | list of one or more | |
eecd1362 LP |
92 | operations to inhibit: |
93 | <literal>shutdown</literal>, | |
4943c1c9 | 94 | <literal>sleep</literal>, |
12a1309e LP |
95 | <literal>idle</literal>, |
96 | <literal>handle-power-key</literal>, | |
2f1bb513 СНА |
97 | <literal>handle-suspend-key</literal>, |
98 | <literal>handle-hibernate-key</literal>, | |
12a1309e LP |
99 | <literal>handle-lid-switch</literal>, |
100 | for inhibiting | |
5b6a2c5a | 101 | reboot/power-off/halt/kexec, |
12a1309e | 102 | suspending/hibernating, the automatic |
16dad32e | 103 | idle detection, or the low-level |
12a1309e | 104 | handling of the power/sleep key and |
16dad32e AE |
105 | the lid switch, respectively. If omitted, |
106 | defaults to | |
12a1309e | 107 | <literal>idle:sleep:shutdown</literal>.</para></listitem> |
eecd1362 LP |
108 | </varlistentry> |
109 | ||
110 | <varlistentry> | |
111 | <term><option>--who=</option></term> | |
112 | ||
e9dd9f95 JSJ |
113 | <listitem><para>Takes a short, |
114 | human-readable descriptive string for the | |
115 | program taking the lock. If not passed, | |
eecd1362 LP |
116 | defaults to the command line |
117 | string.</para></listitem> | |
118 | </varlistentry> | |
119 | ||
120 | <varlistentry> | |
121 | <term><option>--why=</option></term> | |
122 | ||
e9dd9f95 JSJ |
123 | <listitem><para>Takes a short, |
124 | human-readable descriptive string for the | |
eecd1362 LP |
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 | |
e9dd9f95 | 144 | time elapses, the lock is ignored and |
eecd1362 LP |
145 | the operation executed. The time limit |
146 | may be specified in | |
bbf261b7 | 147 | <citerefentry><refentrytitle>logind.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>. Note |
12a1309e | 148 | that <literal>delay</literal> is only |
bb31a4ac | 149 | available for <literal>sleep</literal> |
12a1309e LP |
150 | and |
151 | <literal>shutdown</literal>.</para></listitem> | |
eecd1362 LP |
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> | |
dfdebb1b ZJS |
161 | |
162 | <xi:include href="standard-options.xml" xpointer="help" /> | |
163 | <xi:include href="standard-options.xml" xpointer="version" /> | |
eecd1362 LP |
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 | ||
5b6a2c5a LP |
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><refentrytitle>wodim</refentrytitle><manvolnum>1</manvolnum></citerefentry>, | |
182 | and inhibits system sleeping, shutdown and idle while | |
183 | doing so.</para> | |
184 | </refsect1> | |
185 | ||
eecd1362 LP |
186 | <refsect1> |
187 | <title>See Also</title> | |
188 | <para> | |
189 | <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>, | |
07b4b9b8 | 190 | <citerefentry><refentrytitle>logind.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry> |
eecd1362 LP |
191 | </para> |
192 | </refsect1> | |
193 | ||
194 | </refentry> |