chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
dd5f0a9
)
logind: use "sleep" as generic term for "suspend", "hibernate", and later on "hybrid...
author
Lennart Poettering
<lennart@poettering.net>
Fri, 4 May 2012 22:46:31 +0000
(
00:46
+0200)
committer
Lennart Poettering
<lennart@poettering.net>
Tue, 8 May 2012 11:54:23 +0000
(13:54 +0200)
TODO
patch
|
blob
|
history
man/logind.conf.xml
patch
|
blob
|
history
man/systemd-inhibit.xml
patch
|
blob
|
history
src/login/inhibit.c
patch
|
blob
|
history
src/login/logind-inhibit.c
patch
|
blob
|
history
src/login/logind-inhibit.h
patch
|
blob
|
history
src/login/test-inhibit.c
patch
|
blob
|
history
diff --git
a/TODO
b/TODO
index ebdc98d4177c15271079734804ca43bbd6779429..cd7aecf49ebfc391dc32decb997d090b5a1836c4 100644
(file)
--- a/
TODO
+++ b/
TODO
@@
-41,8
+41,6
@@
Features:
SessionIdleMode=(explicit|ignore|login)
ForceShutdown=(yes|no)
SessionIdleMode=(explicit|ignore|login)
ForceShutdown=(yes|no)
-* logind: use "sleep" as generic term for "suspend", "hibernate", ...
-
* services which create their own subcgroups break cgroup-empty notification (needs to be fixed in the kernel)
* don't delete /tmp/systemd-namespace-* before a process is gone down
* services which create their own subcgroups break cgroup-empty notification (needs to be fixed in the kernel)
* don't delete /tmp/systemd-namespace-* before a process is gone down
diff --git
a/man/logind.conf.xml
b/man/logind.conf.xml
index deca1cdd7f9812048089f281247496cda102db37..166038b383972c06267a31be645b7bfdec51b083 100644
(file)
--- a/
man/logind.conf.xml
+++ b/
man/logind.conf.xml
@@
-151,11
+151,12
@@
<term><varname>InhibitDelayMaxSec=</varname></term>
<listitem><para>Specifies the maximum
<term><varname>InhibitDelayMaxSec=</varname></term>
<listitem><para>Specifies the maximum
- time a suspend or reboot is delayed
- due to an inhibitor lock of type
- <literal>delay</literal> being taken
- before it is ignored and the operation
- executed anyway. Defaults to
+ time a system shutdown or sleep
+ request is delayed due to an inhibitor
+ lock of type <literal>delay</literal>
+ being taken before it is ignored and
+ the operation executed
+ anyway. Defaults to
5s.</para></listitem>
</varlistentry>
5s.</para></listitem>
</varlistentry>
diff --git
a/man/systemd-inhibit.xml
b/man/systemd-inhibit.xml
index 34095902c2b2ac40e9d699ea1a597ee9cada92b7..c71a954428560ada2d2007bd85ec10881beb8791 100644
(file)
--- a/
man/systemd-inhibit.xml
+++ b/
man/systemd-inhibit.xml
@@
-60,14
+60,14
@@
<title>Description</title>
<para><command>systemd-inhibit</command> may be used
<title>Description</title>
<para><command>systemd-inhibit</command> may be used
- to execute a program with a shutdown, s
uspend
or idle
+ to execute a program with a shutdown, s
leep
or idle
inhibitor lock taken. The lock will be acquired before
the specified command line is executed and released
afterwards.</para>
<para>Inhibitor locks may be used to block or delay
inhibitor lock taken. The lock will be acquired before
the specified command line is executed and released
afterwards.</para>
<para>Inhibitor locks may be used to block or delay
- s
uspend
and shutdown requests from the user, as well
- as automatic idle handling of the OS. This
may be used
+ s
ystem 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.</para>
to avoid system suspends while an optical disc is
being recorded, or similar operations that should not
be interrupted.</para>
@@
-101,7
+101,7
@@
separated list of one or more
operations to inhibit:
<literal>shutdown</literal>,
separated list of one or more
operations to inhibit:
<literal>shutdown</literal>,
- <literal>s
uspend
</literal>,
+ <literal>s
leep
</literal>,
<literal>idle</literal>, for
inhibiting reboot/power-off/halt/kexec,
suspending/hibernating, resp. the
<literal>idle</literal>, for
inhibiting reboot/power-off/halt/kexec,
suspending/hibernating, resp. the
diff --git
a/src/login/inhibit.c
b/src/login/inhibit.c
index a817c84b3605b7e1d3a3379a0bbf03692a700310..6f24a1b67176e2fb07e4aee1a5365b7c43baf4ee 100644
(file)
--- a/
src/login/inhibit.c
+++ b/
src/login/inhibit.c
@@
-31,7
+31,7
@@
#include "build.h"
#include "strv.h"
#include "build.h"
#include "strv.h"
-static const char* arg_what = "idle:s
uspend
:shutdown";
+static const char* arg_what = "idle:s
leep
:shutdown";
static const char* arg_who = NULL;
static const char* arg_why = "Unknown reason";
static const char* arg_mode = "block";
static const char* arg_who = NULL;
static const char* arg_why = "Unknown reason";
static const char* arg_mode = "block";
@@
-182,11
+182,11
@@
finish:
static int help(void) {
printf("%s [OPTIONS...] {COMMAND} ...\n\n"
static int help(void) {
printf("%s [OPTIONS...] {COMMAND} ...\n\n"
- "Execute a process while inhibiting shutdown/s
uspend
/idle.\n\n"
+ "Execute a process while inhibiting shutdown/s
leep
/idle.\n\n"
" -h --help Show this help\n"
" --version Show package version\n"
" --what=WHAT Operations to inhibit, colon separated list of idle,\n"
" -h --help Show this help\n"
" --version Show package version\n"
" --what=WHAT Operations to inhibit, colon separated list of idle,\n"
- " s
uspend
, shutdown\n"
+ " s
leep
, shutdown\n"
" --who=STRING A descriptive string who is inhibiting\n"
" --why=STRING A descriptive string why is being inhibited\n"
" --mode=MODE One of block or delay\n"
" --who=STRING A descriptive string who is inhibiting\n"
" --why=STRING A descriptive string why is being inhibited\n"
" --mode=MODE One of block or delay\n"
diff --git
a/src/login/logind-inhibit.c
b/src/login/logind-inhibit.c
index b5b801e5e09a84bcbaa8d9cb43391c66e0304366..2007ec79e4b35a8ff12d1879bef8c5127ed313dc 100644
(file)
--- a/
src/login/logind-inhibit.c
+++ b/
src/login/logind-inhibit.c
@@
-376,12
+376,12
@@
const char *inhibit_what_to_string(InhibitWhat w) {
static const char* const table[_INHIBIT_WHAT_MAX] = {
[0] = "",
[INHIBIT_SHUTDOWN] = "shutdown",
static const char* const table[_INHIBIT_WHAT_MAX] = {
[0] = "",
[INHIBIT_SHUTDOWN] = "shutdown",
- [INHIBIT_S
USPEND] = "suspend
",
+ [INHIBIT_S
LEEP] = "sleep
",
[INHIBIT_IDLE] = "idle",
[INHIBIT_IDLE] = "idle",
- [INHIBIT_SHUTDOWN|INHIBIT_S
USPEND] = "shutdown:suspend
",
+ [INHIBIT_SHUTDOWN|INHIBIT_S
LEEP] = "shutdown:sleep
",
[INHIBIT_SHUTDOWN|INHIBIT_IDLE] = "shutdown:idle",
[INHIBIT_SHUTDOWN|INHIBIT_IDLE] = "shutdown:idle",
- [INHIBIT_SHUTDOWN|INHIBIT_S
USPEND|INHIBIT_IDLE] = "shutdown:suspend
:idle",
- [INHIBIT_S
USPEND|INHIBIT_IDLE] = "suspend
:idle"
+ [INHIBIT_SHUTDOWN|INHIBIT_S
LEEP|INHIBIT_IDLE] = "shutdown:sleep
:idle",
+ [INHIBIT_S
LEEP|INHIBIT_IDLE] = "sleep
:idle"
};
if (w < 0 || w >= _INHIBIT_WHAT_MAX)
};
if (w < 0 || w >= _INHIBIT_WHAT_MAX)
@@
-398,8
+398,8
@@
InhibitWhat inhibit_what_from_string(const char *s) {
FOREACH_WORD_SEPARATOR(w, l, s, ":", state) {
if (l == 8 && strncmp(w, "shutdown", l) == 0)
what |= INHIBIT_SHUTDOWN;
FOREACH_WORD_SEPARATOR(w, l, s, ":", state) {
if (l == 8 && strncmp(w, "shutdown", l) == 0)
what |= INHIBIT_SHUTDOWN;
- else if (l ==
7 && strncmp(w, "suspend
", l) == 0)
- what |= INHIBIT_S
USPEND
;
+ else if (l ==
5 && strncmp(w, "sleep
", l) == 0)
+ what |= INHIBIT_S
LEEP
;
else if (l == 4 && strncmp(w, "idle", l) == 0)
what |= INHIBIT_IDLE;
else
else if (l == 4 && strncmp(w, "idle", l) == 0)
what |= INHIBIT_IDLE;
else
diff --git
a/src/login/logind-inhibit.h
b/src/login/logind-inhibit.h
index 823af399181eb65c6b5f9f949ed5cbc24222c494..6364b00586a22ece7a253822c463dc16265c29e8 100644
(file)
--- a/
src/login/logind-inhibit.h
+++ b/
src/login/logind-inhibit.h
@@
-31,7
+31,7
@@
typedef struct Inhibitor Inhibitor;
typedef enum InhibitWhat {
INHIBIT_SHUTDOWN = 1,
typedef enum InhibitWhat {
INHIBIT_SHUTDOWN = 1,
- INHIBIT_S
USPEND
= 2,
+ INHIBIT_S
LEEP
= 2,
INHIBIT_IDLE = 4,
_INHIBIT_WHAT_MAX = 8,
_INHIBIT_WHAT_INVALID = -1
INHIBIT_IDLE = 4,
_INHIBIT_WHAT_MAX = 8,
_INHIBIT_WHAT_INVALID = -1
diff --git
a/src/login/test-inhibit.c
b/src/login/test-inhibit.c
index 634f1e1284805188ffc2aa38b5717048404419b8..7b6deffc3ede7406bcc1d3fd7adba5ba2adf136d 100644
(file)
--- a/
src/login/test-inhibit.c
+++ b/
src/login/test-inhibit.c
@@
-119,7
+119,7
@@
int main(int argc, char*argv[]) {
print_inhibitors(bus);
print_inhibitors(bus);
- fd1 = inhibit(bus, "s
uspend
");
+ fd1 = inhibit(bus, "s
leep
");
assert(fd1 >= 0);
print_inhibitors(bus);
assert(fd1 >= 0);
print_inhibitors(bus);