diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2020-10-15 19:20:05 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2020-10-19 15:23:37 +0200 |
commit | 21fe744cfb72238822a0df9e0b8f06ef95c52ade (patch) | |
tree | a5ca17b9194907c5e0a8f188a08492c067c9b90a /src/login/logind.c | |
parent | 297fc20dc469694f054ed2be4358eb21efe89660 (diff) | |
download | systemd-21fe744cfb72238822a0df9e0b8f06ef95c52ade.tar.gz |
logind: use notify_start/notify_on_cleanup
Logging about the pid is dropped, pid1 does that better.
Diffstat (limited to 'src/login/logind.c')
-rw-r--r-- | src/login/logind.c | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/src/login/logind.c b/src/login/logind.c index 677a501e98..be018a404d 100644 --- a/src/login/logind.c +++ b/src/login/logind.c @@ -14,6 +14,7 @@ #include "bus-log-control-api.h" #include "bus-polkit.h" #include "cgroup-util.h" +#include "daemon-util.h" #include "def.h" #include "device-util.h" #include "dirent-util.h" @@ -1156,6 +1157,7 @@ static int manager_run(Manager *m) { static int run(int argc, char *argv[]) { _cleanup_(manager_unrefp) Manager *m = NULL; + _cleanup_(notify_on_cleanup) const char *notify_message = NULL; int r; log_set_facility(LOG_AUTH); @@ -1194,19 +1196,8 @@ static int run(int argc, char *argv[]) { if (r < 0) return log_error_errno(r, "Failed to fully start up daemon: %m"); - log_debug("systemd-logind running as pid "PID_FMT, getpid_cached()); - (void) sd_notify(false, - "READY=1\n" - "STATUS=Processing requests..."); - - r = manager_run(m); - - log_debug("systemd-logind stopped as pid "PID_FMT, getpid_cached()); - (void) sd_notify(false, - "STOPPING=1\n" - "STATUS=Shutting down..."); - - return r; + notify_message = notify_start(NOTIFY_READY, NOTIFY_STOPPING); + return manager_run(m); } DEFINE_MAIN_FUNCTION(run); |