]> git.proxmox.com Git - systemd.git/blob - man/systemd-inhibit.html
Imported Upstream version 220
[systemd.git] / man / systemd-inhibit.html
1 <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>
2 a.headerlink {
3 color: #c60f0f;
4 font-size: 0.8em;
5 padding: 0 4px 0 4px;
6 text-decoration: none;
7 visibility: hidden;
8 }
9
10 a.headerlink:hover {
11 background-color: #c60f0f;
12 color: white;
13 }
14
15 h1:hover > a.headerlink, h2:hover > a.headerlink, h3:hover > a.headerlink, dt:hover > a.headerlink {
16 visibility: visible;
17 }
18 </style><a href="index.html">Index </a>·
19 <a href="systemd.directives.html">Directives </a>·
20 <a href="../python-systemd/index.html">Python </a>·
21 <a href="../libudev/index.html">libudev </a>·
22 <a href="../libudev/index.html">gudev </a><span style="float:right">systemd 220</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="idm140387152908368"></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
23 program with a shutdown, sleep or idle inhibitor lock taken. The
24 lock will be acquired before the specified command line is
25 executed and released afterwards.</p><p>Inhibitor locks may be used to block or delay system sleep
26 and shutdown requests from the user, as well as automatic idle
27 handling of the OS. This is useful to avoid system suspends while
28 an optical disc is being recorded, or similar operations that
29 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
30 Lock Developer Documentation</a>.</p></div><div class="refsect1"><a name="idm140387152904816"></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
31 operations to inhibit:
32 "<code class="literal">shutdown</code>",
33 "<code class="literal">sleep</code>",
34 "<code class="literal">idle</code>",
35 "<code class="literal">handle-power-key</code>",
36 "<code class="literal">handle-suspend-key</code>",
37 "<code class="literal">handle-hibernate-key</code>",
38 "<code class="literal">handle-lid-switch</code>",
39 for inhibiting reboot/power-off/halt/kexec,
40 suspending/hibernating, the automatic idle detection, or the
41 low-level handling of the power/sleep key and the lid switch,
42 respectively. If omitted, defaults to
43 "<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
44 string for the program taking the lock. If not passed,
45 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
46 string for the reason for taking the lock. Defaults to
47 "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
48 "<code class="literal">delay</code>" and describes how the lock is
49 applied. If "<code class="literal">block</code>" is used (the default),
50 the lock prohibits any of the requested operations without
51 time limit, and only privileged users may override it. If
52 "<code class="literal">delay</code>" is used, the lock can only delay the
53 requested operations for a limited time. If the time elapses,
54 the lock is ignored and the operation executed. The time limit
55 may be specified in
56 <a href="logind.conf.html"><span class="citerefentry"><span class="refentrytitle">logind.conf</span>(5)</span></a>.
57 Note that "<code class="literal">delay</code>" is only available for
58 "<code class="literal">sleep</code>" and
59 "<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
60 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.
61 </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="idm140387152883680"></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="idm140387152882528"></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
62 <code class="filename">foobar.iso</code> on a CD using
63 <a href="http://man7.org/linux/man-pages/man1/wodim.1.html"><span class="citerefentry"><span class="refentrytitle">wodim</span>(1)</span></a>,
64 and inhibits system sleeping, shutdown and idle while
65 doing so.</p></div><div class="refsect1"><a name="idm140387152879024"></a><h2 id="See Also">See Also<a class="headerlink" title="Permalink to this headline" href="#See%20Also"></a></h2><p>
66 <a href="systemd.html"><span class="citerefentry"><span class="refentrytitle">systemd</span>(1)</span></a>,
67 <a href="logind.conf.html"><span class="citerefentry"><span class="refentrytitle">logind.conf</span>(5)</span></a>
68 </p></div></div></body></html>