summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2012-10-18 01:19:35 +0200
committerLennart Poettering <lennart@poettering.net>2012-10-18 01:19:35 +0200
commit600b704eb0fe4b4fd2901017082254634823f02d (patch)
tree722177bb794a763dc03f58443adbe221828b8b8b
parent97ae63e2a9c07ee64ab9f226b9b6121114f1d732 (diff)
manager: connect SIGRTMIN+24 to terminating --user instances
-rw-r--r--man/systemd.xml8
-rw-r--r--src/core/manager.c10
2 files changed, 18 insertions, 0 deletions
diff --git a/man/systemd.xml b/man/systemd.xml
index f14e3eb9ae..77585248a9 100644
--- a/man/systemd.xml
+++ b/man/systemd.xml
@@ -838,6 +838,14 @@
</varlistentry>
<varlistentry>
+ <term>SIGRTMIN+24</term>
+
+ <listitem><para>Immediately exits the
+ manager (only available for --user
+ instances).</para></listitem>
+ </varlistentry>
+
+ <varlistentry>
<term>SIGRTMIN+26</term>
<term>SIGRTMIN+27</term>
<term>SIGRTMIN+28</term>
diff --git a/src/core/manager.c b/src/core/manager.c
index b19fc3d508..f932c79a1b 100644
--- a/src/core/manager.c
+++ b/src/core/manager.c
@@ -199,6 +199,7 @@ static int manager_setup_signals(Manager *m) {
SIGRTMIN+21, /* systemd: disable status messages */
SIGRTMIN+22, /* systemd: set log level to LOG_DEBUG */
SIGRTMIN+23, /* systemd: set log level to LOG_INFO */
+ SIGRTMIN+24, /* systemd: Immediate exit (--user only) */
SIGRTMIN+26, /* systemd: set log target to journal-or-kmsg */
SIGRTMIN+27, /* systemd: set log target to console */
SIGRTMIN+28, /* systemd: set log target to kmsg */
@@ -1272,6 +1273,15 @@ static int manager_process_signal_fd(Manager *m) {
log_notice("Setting log level to info.");
break;
+ case 24:
+ if (m->running_as == SYSTEMD_USER) {
+ m->exit_code = MANAGER_EXIT;
+ return 0;
+ }
+
+ /* This is a nop on init */
+ break;
+
case 26:
log_set_target(LOG_TARGET_JOURNAL_OR_KMSG);
log_notice("Setting log target to journal-or-kmsg.");