notify: send STOPPING=1 from our daemons

This commit is contained in:
Lennart Poettering
2014-08-21 17:24:21 +02:00
parent 308d72dc1e
commit af4ec4309e
13 changed files with 39 additions and 10 deletions
+5 -1
View 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);
+2 -1
View 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));
}
+1
View File
@@ -431,6 +431,7 @@ int main(int argc, char *argv[]) {
fail:
sd_notify(false,
"STOPPING=1\n"
"STATUS=Shutting down...");
server_done(&server);
+4 -2
View 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);
+4 -1
View 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:
+3 -1
View 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);
+1
View File
@@ -1226,6 +1226,7 @@ int main(int argc, char *argv[]) {
finish:
sd_notify(false,
"STOPPING=1\n"
"STATUS=Shutting down...");
if (m)
+1
View File
@@ -350,6 +350,7 @@ int main(int argc, char *argv[]) {
finish:
sd_notify(false,
"STOPPING=1\n"
"STATUS=Shutting down...");
if (m)
+1
View 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;
+7 -1
View 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)
+3 -1
View 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;
}
+1
View File
@@ -456,6 +456,7 @@ finish:
}
sd_notify(false,
"STOPPING=\n"
"STATUS=Exiting...");
return r;
+6 -2
View 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;
}