]> git.ipfire.org Git - thirdparty/systemd.git/blame - man/systemd-inhibit.xml
tree-wide: drop license boilerplate
[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
134 <xi:include href="standard-options.xml" xpointer="help" />
135 <xi:include href="standard-options.xml" xpointer="version" />
136 </variablelist>
137
138 </refsect1>
139
140 <refsect1>
141 <title>Exit status</title>
142
143 <para>Returns the exit status of the executed program.</para>
144 </refsect1>
145
146 <refsect1>
147 <title>Example</title>
148
149 <programlisting># systemd-inhibit wodim foobar.iso</programlisting>
150
151 <para>This burns the ISO image
152 <filename>foobar.iso</filename> on a CD using
153 <citerefentry project='man-pages'><refentrytitle>wodim</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
154 and inhibits system sleeping, shutdown and idle while
155 doing so.</para>
156 </refsect1>
157
158 <refsect1>
159 <title>See Also</title>
160 <para>
161 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
162 <citerefentry><refentrytitle>logind.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>
163 </para>
164 </refsect1>
eecd1362
LP
165
166</refentry>