summaryrefslogtreecommitdiff
path: root/src/login/logind.c
diff options
context:
space:
mode:
authorStefan Stefanović <stefanx2ovic@gmail.com>2018-11-04 18:39:03 +0100
committerSven Eden <sven.eden@prydeworx.com>2018-11-10 10:00:27 +0100
commit9f54ff0832237f4040ee9f13679a62425a78a86e (patch)
tree3e83dae73c01884354b0dbc18b66eb6ad47d2cd1 /src/login/logind.c
parentc35c7b3a589e8f7f99e9fd0e7e853210af5fea9c (diff)
elogind: Try to register any of the signals report errors and return the first error.
Diffstat (limited to 'src/login/logind.c')
-rw-r--r--src/login/logind.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/login/logind.c b/src/login/logind.c
index d9b777fed..558733b30 100644
--- a/src/login/logind.c
+++ b/src/login/logind.c
@@ -89,7 +89,7 @@ static int manager_new(Manager **ret) {
if (r < 0)
return r;
-#if 0 /// elogind uses its own signal handler, installed at elogind_manager_new()
+#if 0 /// elogind uses its own signal handler, installed at elogind_manager_startup()
r = sd_event_add_signal(m->event, NULL, SIGINT, NULL, NULL);
if (r < 0)
return r;
@@ -1153,6 +1153,12 @@ static int manager_startup(Manager *m) {
if (r < 0)
return log_error_errno(r, "Failed to register SIGHUP handler: %m");
+#if 1 /// install elogind specific signal handlers
+ r = elogind_manager_startup(m);
+ if (r < 0)
+ return log_error_errno(r, "Failed to register elogind signal handlers: %m");
+#endif // 1
+
/* Connect to utmp */
manager_connect_utmp(m);
@@ -1326,7 +1332,11 @@ int main(int argc, char *argv[]) {
return log_error_errno(r, "Failed to create /run/systemd/machines : %m");
#endif // 0
+#if 0 /// elogind also blocks SIGQUIT, and installs a signal handler for it
assert_se(sigprocmask_many(SIG_BLOCK, NULL, SIGHUP, SIGTERM, SIGINT, -1) >= 0);
+#else
+ assert_se(sigprocmask_many(SIG_BLOCK, NULL, SIGHUP, SIGTERM, SIGINT, SIGQUIT, -1) >= 0);
+#endif // 0
r = manager_new(&m);
if (r < 0) {