]> git.ipfire.org Git - thirdparty/systemd.git/blame - man/systemd-inhibit.xml
man: xinclude the generic text to talk about libsystemd pkgconfig
[thirdparty/systemd.git] / man / systemd-inhibit.xml
CommitLineData
eecd1362
LP
1<?xml version='1.0'?> <!--*-nxml-*-->
2<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
12b42c76 3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
eecd1362
LP
4
5<!--
572eb058
ZJS
6 SPDX-License-Identifier: LGPL-2.1+
7
eecd1362
LP
8 This file is part of systemd.
9
10 Copyright 2012 Lennart Poettering
eecd1362
LP
11-->
12
dfdebb1b 13<refentry id="systemd-inhibit"
798d3a52
ZJS
14 xmlns:xi="http://www.w3.org/2001/XInclude">
15
16 <refentryinfo>
17 <title>systemd-inhibit</title>
18 <productname>systemd</productname>
19
20 <authorgroup>
21 <author>
22 <contrib>Developer</contrib>
23 <firstname>Lennart</firstname>
24 <surname>Poettering</surname>
25 <email>lennart@poettering.net</email>
26 </author>
27 </authorgroup>
28 </refentryinfo>
29
30 <refmeta>
31 <refentrytitle>systemd-inhibit</refentrytitle>
32 <manvolnum>1</manvolnum>
33 </refmeta>
34
35 <refnamediv>
36 <refname>systemd-inhibit</refname>
37 <refpurpose>Execute a program with an inhibition lock taken</refpurpose>
38 </refnamediv>
39
40 <refsynopsisdiv>
41 <cmdsynopsis>
42 <command>systemd-inhibit <arg choice="opt" rep="repeat">OPTIONS</arg> <arg>COMMAND</arg> <arg choice="opt" rep="repeat">ARGUMENTS</arg></command>
43 </cmdsynopsis>
44 <cmdsynopsis>
45 <command>systemd-inhibit <arg choice="opt" rep="repeat">OPTIONS</arg> --list</command>
46 </cmdsynopsis>
47 </refsynopsisdiv>
48
49 <refsect1>
50 <title>Description</title>
51
52 <para><command>systemd-inhibit</command> may be used to execute a
05b2a8fd 53 program with a shutdown, sleep, or idle inhibitor lock taken. The
798d3a52
ZJS
54 lock will be acquired before the specified command line is
55 executed and released afterwards.</para>
56
57 <para>Inhibitor locks may be used to block or delay system sleep
58 and shutdown requests from the user, as well as automatic idle
59 handling of the OS. This is useful to avoid system suspends while
60 an optical disc is being recorded, or similar operations that
61 should not be interrupted.</para>
62
63 <para>For more information see the <ulink
28a0ad81 64 url="https://www.freedesktop.org/wiki/Software/systemd/inhibit">Inhibitor
798d3a52
ZJS
65 Lock Developer Documentation</ulink>.</para>
66 </refsect1>
67
68 <refsect1>
69 <title>Options</title>
70
71 <para>The following options are understood:</para>
72
73 <variablelist>
74 <varlistentry>
75 <term><option>--what=</option></term>
76
77 <listitem><para>Takes a colon-separated list of one or more
78 operations to inhibit:
79 <literal>shutdown</literal>,
80 <literal>sleep</literal>,
81 <literal>idle</literal>,
82 <literal>handle-power-key</literal>,
83 <literal>handle-suspend-key</literal>,
84 <literal>handle-hibernate-key</literal>,
85 <literal>handle-lid-switch</literal>,
86 for inhibiting reboot/power-off/halt/kexec,
87 suspending/hibernating, the automatic idle detection, or the
88 low-level handling of the power/sleep key and the lid switch,
89 respectively. If omitted, defaults to
90 <literal>idle:sleep:shutdown</literal>.</para></listitem>
91 </varlistentry>
92
93 <varlistentry>
94 <term><option>--who=</option></term>
95
96 <listitem><para>Takes a short, human-readable descriptive
97 string for the program taking the lock. If not passed,
98 defaults to the command line string.</para></listitem>
99 </varlistentry>
100
101 <varlistentry>
102 <term><option>--why=</option></term>
103
104 <listitem><para>Takes a short, human-readable descriptive
105 string for the reason for taking the lock. Defaults to
106 "Unknown reason".</para></listitem>
107 </varlistentry>
108
109 <varlistentry>
110 <term><option>--mode=</option></term>
111
112 <listitem><para>Takes either <literal>block</literal> or
113 <literal>delay</literal> and describes how the lock is
114 applied. If <literal>block</literal> is used (the default),
115 the lock prohibits any of the requested operations without
116 time limit, and only privileged users may override it. If
117 <literal>delay</literal> is used, the lock can only delay the
118 requested operations for a limited time. If the time elapses,
119 the lock is ignored and the operation executed. The time limit
120 may be specified in
121 <citerefentry><refentrytitle>logind.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
122 Note that <literal>delay</literal> is only available for
123 <literal>sleep</literal> and
124 <literal>shutdown</literal>.</para></listitem>
125 </varlistentry>
126
127 <varlistentry>
128 <term><option>--list</option></term>
129
130 <listitem><para>Lists all active inhibition locks instead of
131 acquiring one.</para></listitem>
132 </varlistentry>
133
f3c9133c 134 <xi:include href="standard-options.xml" xpointer="no-pager" />
798d3a52
ZJS
135 <xi:include href="standard-options.xml" xpointer="help" />
136 <xi:include href="standard-options.xml" xpointer="version" />
137 </variablelist>
138
139 </refsect1>
140
141 <refsect1>
142 <title>Exit status</title>
143
144 <para>Returns the exit status of the executed program.</para>
145 </refsect1>
146
147 <refsect1>
148 <title>Example</title>
149
150 <programlisting># systemd-inhibit wodim foobar.iso</programlisting>
151
152 <para>This burns the ISO image
153 <filename>foobar.iso</filename> on a CD using
154 <citerefentry project='man-pages'><refentrytitle>wodim</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
155 and inhibits system sleeping, shutdown and idle while
156 doing so.</para>
157 </refsect1>
158
f3c9133c
DT
159 <xi:include href="less-variables.xml" />
160
798d3a52
ZJS
161 <refsect1>
162 <title>See Also</title>
163 <para>
164 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
165 <citerefentry><refentrytitle>logind.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>
166 </para>
167 </refsect1>
eecd1362
LP
168
169</refentry>