chiark / gitweb /
notify: send STOPPING=1 from our daemons
authorLennart Poettering <lennart@poettering.net>
Thu, 21 Aug 2014 15:19:28 +0000 (17:19 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 21 Aug 2014 15:24:21 +0000 (17:24 +0200)
13 files changed:
src/bus-proxyd/bus-proxyd.c
src/core/manager.c
src/initctl/initctl.c
src/journal-remote/journal-remote.c
src/journal-remote/journal-upload.c
src/journal/journald.c
src/login/logind.c
src/machine/machined.c
src/network/networkd.c
src/nspawn/nspawn.c
src/resolve/resolved.c
src/shutdownd/shutdownd.c
src/timesync/timesyncd.c

index d8d989b..d35d7f6 100644 (file)
@@ -239,7 +239,7 @@ static int rename_service(sd_bus *a, sd_bus *b) {
                   pid, p,
                   uid, name,
                   a->unique_name);
-                ;
+
         return 0;
 }
 
@@ -1474,6 +1474,10 @@ int main(int argc, char *argv[]) {
         }
 
 finish:
+        sd_notify(false,
+                  "STOPPING=1\n"
+                  "STATUS=Shutting down.");
+
         policy_free(&policy);
         strv_free(arg_configuration);
         free(arg_address);
index c91ece1..7401817 100644 (file)
@@ -2551,7 +2551,8 @@ void manager_check_finished(Manager *m) {
         bus_manager_send_finished(m, firmware_usec, loader_usec, kernel_usec, initrd_usec, userspace_usec, total_usec);
 
         sd_notifyf(false,
-                   "READY=1\nSTATUS=Startup finished in %s.",
+                   "READY=1\n"
+                   "STATUS=Startup finished in %s.",
                    format_timespan(sum, sizeof(sum), total_usec, USEC_PER_MSEC));
 }
 
index 0954e58..f1c2b8d 100644 (file)
@@ -431,6 +431,7 @@ int main(int argc, char *argv[]) {
 
 fail:
         sd_notify(false,
+                  "STOPPING=1\n"
                   "STATUS=Shutting down...");
 
         server_done(&server);
index 7f422bf..1cc86ae 100644 (file)
@@ -1530,10 +1530,12 @@ int main(int argc, char **argv) {
                 }
         }
 
-        server_destroy(&s);
+        sd_notifyf(false,
+                   "STOPPING=1\n"
+                   "STATUS=Shutting down after writing %" PRIu64 " entries...", s.event_count);
         log_info("Finishing after writing %" PRIu64 " entries", s.event_count);
 
-        sd_notify(false, "STATUS=Shutting down...");
+        server_destroy(&s);
 
         free(arg_key);
         free(arg_cert);
index bdeeff6..40c380a 100644 (file)
@@ -818,7 +818,10 @@ int main(int argc, char **argv) {
         }
 
 cleanup:
-        sd_notify(false, "STATUS=Shutting down...");
+        sd_notify(false,
+                  "STOPPING=1\n"
+                  "STATUS=Shutting down...");
+
         destroy_uploader(&u);
 
 finish:
index b1a0e25..de40827 100644 (file)
@@ -116,7 +116,9 @@ int main(int argc, char *argv[]) {
         server_driver_message(&server, SD_MESSAGE_JOURNAL_STOP, "Journal stopped");
 
 finish:
-        sd_notify(false, "STATUS=Shutting down...");
+        sd_notify(false,
+                  "STOPPING=1\n"
+                  "STATUS=Shutting down...");
 
         server_done(&server);
 
index 006c56a..52e1c43 100644 (file)
@@ -1226,6 +1226,7 @@ int main(int argc, char *argv[]) {
 
 finish:
         sd_notify(false,
+                  "STOPPING=1\n"
                   "STATUS=Shutting down...");
 
         if (m)
index 6160320..f9d180d 100644 (file)
@@ -350,6 +350,7 @@ int main(int argc, char *argv[]) {
 
 finish:
         sd_notify(false,
+                  "STOPPING=1\n"
                   "STATUS=Shutting down...");
 
         if (m)
index 665f4c4..fdb8036 100644 (file)
@@ -125,6 +125,7 @@ int main(int argc, char *argv[]) {
 
 out:
         sd_notify(false,
+                  "STOPPING=1\n"
                   "STATUS=Shutting down...");
 
         return r < 0 ? EXIT_FAILURE : EXIT_SUCCESS;
index d01da45..2c71855 100644 (file)
@@ -3071,7 +3071,9 @@ int main(int argc, char *argv[]) {
                 goto finish;
         }
 
-        sd_notify(0, "READY=1");
+        sd_notify(false,
+                  "READY=1\n"
+                  "STATUS=Container running.");
 
         assert_se(sigemptyset(&mask) == 0);
         assert_se(sigemptyset(&mask_chld) == 0);
@@ -3504,6 +3506,10 @@ int main(int argc, char *argv[]) {
         }
 
 finish:
+        sd_notify(false,
+                  "STOPPING=1\n"
+                  "STATUS=Terminating...");
+
         loop_remove(loop_nr, &image_fd);
 
         if (pid > 0)
index 8235558..88c3bcc 100644 (file)
@@ -100,7 +100,9 @@ int main(int argc, char *argv[]) {
         sd_event_get_exit_code(m->event, &r);
 
 finish:
-        sd_notify(false, "STATUS=Shutting down...");
+        sd_notify(false,
+                  "STOPPIN=1\n"
+                  "STATUS=Shutting down...");
 
         return r < 0 ? EXIT_FAILURE : EXIT_SUCCESS;
 }
index 9290749..99aa4b3 100644 (file)
@@ -456,6 +456,7 @@ finish:
         }
 
         sd_notify(false,
+                  "STOPPING=\n"
                   "STATUS=Exiting...");
 
         return r;
index 351bfd0..ee3bc99 100644 (file)
@@ -132,7 +132,9 @@ int main(int argc, char *argv[]) {
                 log_warning("Failed to parse configuration file: %s", strerror(-r));
 
         log_debug("systemd-timesyncd running as pid %lu", (unsigned long) getpid());
-        sd_notify(false, "READY=1");
+        sd_notify(false,
+                  "READY=1\n"
+                  "STATUS=Daemon is running");
 
         if (network_is_online()) {
                 r = manager_connect(m);
@@ -153,7 +155,9 @@ int main(int argc, char *argv[]) {
         sd_event_get_exit_code(m->event, &r);
 
 finish:
-        sd_notify(false, "STATUS=Shutting down...");
+        sd_notify(false,
+                  "STOPPING=1\n"
+                  "STATUS=Shutting down...");
 
         return r < 0 ? EXIT_FAILURE : EXIT_SUCCESS;
 }