]> git.ipfire.org Git - thirdparty/systemd.git/blob - man/systemd-inhibit.xml
man: generate configured paths in manpages
[thirdparty/systemd.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 <!ENTITY % entities SYSTEM "custom-entities.ent" >
5 %entities;
6 ]>
7
8 <!--
9 This file is part of systemd.
10
11 Copyright 2012 Lennart Poettering
12
13 systemd is free software; you can redistribute it and/or modify it
14 under the terms of the GNU Lesser General Public License as published by
15 the Free Software Foundation; either version 2.1 of the License, or
16 (at your option) any later version.
17
18 systemd is distributed in the hope that it will be useful, but
19 WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 Lesser General Public License for more details.
22
23 You should have received a copy of the GNU Lesser General Public License
24 along with systemd; If not, see <http://www.gnu.org/licenses/>.
25 -->
26
27 <refentry id="systemd-inhibit"
28 xmlns:xi="http://www.w3.org/2001/XInclude">
29
30 <refentryinfo>
31 <title>systemd-inhibit</title>
32 <productname>systemd</productname>
33
34 <authorgroup>
35 <author>
36 <contrib>Developer</contrib>
37 <firstname>Lennart</firstname>
38 <surname>Poettering</surname>
39 <email>lennart@poettering.net</email>
40 </author>
41 </authorgroup>
42 </refentryinfo>
43
44 <refmeta>
45 <refentrytitle>systemd-inhibit</refentrytitle>
46 <manvolnum>1</manvolnum>
47 </refmeta>
48
49 <refnamediv>
50 <refname>systemd-inhibit</refname>
51 <refpurpose>Execute a program with an inhibition lock taken</refpurpose>
52 </refnamediv>
53
54 <refsynopsisdiv>
55 <cmdsynopsis>
56 <command>systemd-inhibit <arg choice="opt" rep="repeat">OPTIONS</arg> <arg>COMMAND</arg> <arg choice="opt" rep="repeat">ARGUMENTS</arg></command>
57 </cmdsynopsis>
58 <cmdsynopsis>
59 <command>systemd-inhibit <arg choice="opt" rep="repeat">OPTIONS</arg> --list</command>
60 </cmdsynopsis>
61 </refsynopsisdiv>
62
63 <refsect1>
64 <title>Description</title>
65
66 <para><command>systemd-inhibit</command> may be used to execute a
67 program with a shutdown, sleep or idle inhibitor lock taken. The
68 lock will be acquired before the specified command line is
69 executed and released afterwards.</para>
70
71 <para>Inhibitor locks may be used to block or delay system sleep
72 and shutdown requests from the user, as well as automatic idle
73 handling of the OS. This is useful to avoid system suspends while
74 an optical disc is being recorded, or similar operations that
75 should not be interrupted.</para>
76
77 <para>For more information see the <ulink
78 url="http://www.freedesktop.org/wiki/Software/systemd/inhibit">Inhibitor
79 Lock Developer Documentation</ulink>.</para>
80 </refsect1>
81
82 <refsect1>
83 <title>Options</title>
84
85 <para>The following options are understood:</para>
86
87 <variablelist>
88 <varlistentry>
89 <term><option>--what=</option></term>
90
91 <listitem><para>Takes a colon-separated 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 reboot/power-off/halt/kexec,
101 suspending/hibernating, the automatic idle detection, or the
102 low-level handling of the power/sleep key and the lid switch,
103 respectively. If omitted, defaults to
104 <literal>idle:sleep:shutdown</literal>.</para></listitem>
105 </varlistentry>
106
107 <varlistentry>
108 <term><option>--who=</option></term>
109
110 <listitem><para>Takes a short, human-readable descriptive
111 string for the program taking the lock. If not passed,
112 defaults to the command line string.</para></listitem>
113 </varlistentry>
114
115 <varlistentry>
116 <term><option>--why=</option></term>
117
118 <listitem><para>Takes a short, human-readable descriptive
119 string for the reason for taking the lock. Defaults to
120 "Unknown reason".</para></listitem>
121 </varlistentry>
122
123 <varlistentry>
124 <term><option>--mode=</option></term>
125
126 <listitem><para>Takes either <literal>block</literal> or
127 <literal>delay</literal> and describes how the lock is
128 applied. If <literal>block</literal> is used (the default),
129 the lock prohibits any of the requested operations without
130 time limit, and only privileged users may override it. If
131 <literal>delay</literal> is used, the lock can only delay the
132 requested operations for a limited time. If the time elapses,
133 the lock is ignored and the operation executed. The time limit
134 may be specified in
135 <citerefentry><refentrytitle>logind.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
136 Note that <literal>delay</literal> is only available for
137 <literal>sleep</literal> and
138 <literal>shutdown</literal>.</para></listitem>
139 </varlistentry>
140
141 <varlistentry>
142 <term><option>--list</option></term>
143
144 <listitem><para>Lists all active inhibition locks instead of
145 acquiring one.</para></listitem>
146 </varlistentry>
147
148 <xi:include href="standard-options.xml" xpointer="help" />
149 <xi:include href="standard-options.xml" xpointer="version" />
150 </variablelist>
151
152 </refsect1>
153
154 <refsect1>
155 <title>Exit status</title>
156
157 <para>Returns the exit status of the executed program.</para>
158 </refsect1>
159
160 <refsect1>
161 <title>Example</title>
162
163 <programlisting># systemd-inhibit wodim foobar.iso</programlisting>
164
165 <para>This burns the ISO image
166 <filename>foobar.iso</filename> on a CD using
167 <citerefentry project='man-pages'><refentrytitle>wodim</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
168 and inhibits system sleeping, shutdown and idle while
169 doing so.</para>
170 </refsect1>
171
172 <refsect1>
173 <title>See Also</title>
174 <para>
175 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
176 <citerefentry><refentrytitle>logind.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>
177 </para>
178 </refsect1>
179
180 </refentry>