1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>systemd-inhibit</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><style>
a.headerlink {
color: #c60f0f;
font-size: 0.8em;
padding: 0 4px 0 4px;
text-decoration: none;
visibility: hidden;
}
a.headerlink:hover {
background-color: #c60f0f;
color: white;
}
h1:hover > a.headerlink, h2:hover > a.headerlink, h3:hover > a.headerlink, dt:hover > a.headerlink {
visibility: visible;
}
</style><a href="index.html">Index </a>·
<a href="systemd.directives.html">Directives </a>·
<a href="../python-systemd/index.html">Python </a>·
<span style="float:right">systemd 221</span><hr><div class="refentry"><a name="systemd-inhibit"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>systemd-inhibit — Execute a program with an inhibition lock taken</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="cmdsynopsis"><p><code class="command">systemd-inhibit [OPTIONS...] [COMMAND] [ARGUMENTS...]</code> </p></div><div class="cmdsynopsis"><p><code class="command">systemd-inhibit [OPTIONS...] --list</code> </p></div></div><div class="refsect1"><a name="idm47568182588512"></a><h2 id="Description">Description<a class="headerlink" title="Permalink to this headline" href="#Description">¶</a></h2><p><span class="command"><strong>systemd-inhibit</strong></span> may be used to execute a
program with a shutdown, sleep or idle inhibitor lock taken. The
lock will be acquired before the specified command line is
executed and released afterwards.</p><p>Inhibitor locks may be used to block or delay system sleep
and shutdown requests from the user, as well as automatic idle
handling of the OS. This is useful to avoid system suspends while
an optical disc is being recorded, or similar operations that
should not be interrupted.</p><p>For more information see the <a class="ulink" href="http://www.freedesktop.org/wiki/Software/systemd/inhibit" target="_top">Inhibitor
Lock Developer Documentation</a>.</p></div><div class="refsect1"><a name="idm47568182584816"></a><h2 id="Options">Options<a class="headerlink" title="Permalink to this headline" href="#Options">¶</a></h2><p>The following options are understood:</p><div class="variablelist"><dl class="variablelist"><dt id="--what="><span class="term"><code class="option">--what=</code></span><a class="headerlink" title="Permalink to this term" href="#--what=">¶</a></dt><dd><p>Takes a colon-separated list of one or more
operations to inhibit:
"<code class="literal">shutdown</code>",
"<code class="literal">sleep</code>",
"<code class="literal">idle</code>",
"<code class="literal">handle-power-key</code>",
"<code class="literal">handle-suspend-key</code>",
"<code class="literal">handle-hibernate-key</code>",
"<code class="literal">handle-lid-switch</code>",
for inhibiting reboot/power-off/halt/kexec,
suspending/hibernating, the automatic idle detection, or the
low-level handling of the power/sleep key and the lid switch,
respectively. If omitted, defaults to
"<code class="literal">idle:sleep:shutdown</code>".</p></dd><dt id="--who="><span class="term"><code class="option">--who=</code></span><a class="headerlink" title="Permalink to this term" href="#--who=">¶</a></dt><dd><p>Takes a short, human-readable descriptive
string for the program taking the lock. If not passed,
defaults to the command line string.</p></dd><dt id="--why="><span class="term"><code class="option">--why=</code></span><a class="headerlink" title="Permalink to this term" href="#--why=">¶</a></dt><dd><p>Takes a short, human-readable descriptive
string for the reason for taking the lock. Defaults to
"Unknown reason".</p></dd><dt id="--mode="><span class="term"><code class="option">--mode=</code></span><a class="headerlink" title="Permalink to this term" href="#--mode=">¶</a></dt><dd><p>Takes either "<code class="literal">block</code>" or
"<code class="literal">delay</code>" and describes how the lock is
applied. If "<code class="literal">block</code>" is used (the default),
the lock prohibits any of the requested operations without
time limit, and only privileged users may override it. If
"<code class="literal">delay</code>" is used, the lock can only delay the
requested operations for a limited time. If the time elapses,
the lock is ignored and the operation executed. The time limit
may be specified in
<a href="logind.conf.html"><span class="citerefentry"><span class="refentrytitle">logind.conf</span>(5)</span></a>.
Note that "<code class="literal">delay</code>" is only available for
"<code class="literal">sleep</code>" and
"<code class="literal">shutdown</code>".</p></dd><dt id="--list"><span class="term"><code class="option">--list</code></span><a class="headerlink" title="Permalink to this term" href="#--list">¶</a></dt><dd><p>Lists all active inhibition locks instead of
acquiring one.</p></dd><dt id="-h"><span class="term"><code class="option">-h</code>, </span><span class="term"><code class="option">--help</code></span><a class="headerlink" title="Permalink to this term" href="#-h">¶</a></dt><dd><p><a name="help-text"></a>Print a short help text and exit.
</p></dd><dt id="--version"><span class="term"><code class="option">--version</code></span><a class="headerlink" title="Permalink to this term" href="#--version">¶</a></dt><dd><p><a name="version-text"></a>Print a short version string and exit.</p></dd></dl></div></div><div class="refsect1"><a name="idm47568177891712"></a><h2 id="Exit status">Exit status<a class="headerlink" title="Permalink to this headline" href="#Exit%20status">¶</a></h2><p>Returns the exit status of the executed program.</p></div><div class="refsect1"><a name="idm47568177890560"></a><h2 id="Example">Example<a class="headerlink" title="Permalink to this headline" href="#Example">¶</a></h2><pre class="programlisting"># systemd-inhibit wodim foobar.iso</pre><p>This burns the ISO image
<code class="filename">foobar.iso</code> on a CD using
<a href="http://man7.org/linux/man-pages/man1/wodim.1.html"><span class="citerefentry"><span class="refentrytitle">wodim</span>(1)</span></a>,
and inhibits system sleeping, shutdown and idle while
doing so.</p></div><div class="refsect1"><a name="idm47568177887056"></a><h2 id="See Also">See Also<a class="headerlink" title="Permalink to this headline" href="#See%20Also">¶</a></h2><p>
<a href="systemd.html"><span class="citerefentry"><span class="refentrytitle">systemd</span>(1)</span></a>,
<a href="logind.conf.html"><span class="citerefentry"><span class="refentrytitle">logind.conf</span>(5)</span></a>
</p></div></div></body></html>
|