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