summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2015-05-29 18:38:44 +0200
committerTom Gundersen <teg@jklm.no>2015-05-29 18:52:13 +0200
commitb79aacbff61e77c5fa579e30f7c6fc7f2d67e9e4 (patch)
tree796eb31bf73a5a69ade85853fb3ac24e81fe088b
parent39fd2ca1616e6d0bc8ca49bb8de1245a9087f2a2 (diff)
udevd: notify - expose a bit more of the internal state
This notifies PID1 about config being flushed, about shutdown starting and shutdown finalizing.
-rw-r--r--src/udev/udevd.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/udev/udevd.c b/src/udev/udevd.c
index 81ba6650e4..fae8f7895d 100644
--- a/src/udev/udevd.c
+++ b/src/udev/udevd.c
@@ -730,6 +730,10 @@ static void manager_exit(Manager *manager) {
manager->exit = true;
+ sd_notify(false,
+ "STOPPING=1\n"
+ "STATUS=Starting shutdown...");
+
/* close sources of new events and discard buffered events */
manager->ctrl = udev_ctrl_unref(manager->ctrl);
manager->ctrl_event = sd_event_source_unref(manager->ctrl_event);
@@ -759,9 +763,17 @@ static void manager_reload(Manager *manager) {
assert(manager);
+ sd_notify(false,
+ "RELOADING=1\n"
+ "STATUS=Flushing configuration...");
+
manager_kill_workers(manager);
manager->rules = udev_rules_unref(manager->rules);
udev_builtin_exit(manager->udev);
+
+ sd_notify(false,
+ "READY=1\n"
+ "STATUS=Processing...");
}
static void event_queue_start(Manager *manager) {
@@ -1703,6 +1715,10 @@ int main(int argc, char *argv[]) {
sd_event_get_exit_code(manager->event, &r);
exit:
+ sd_notify(false,
+ "STOPPING=1\n"
+ "STATUS=Shutting down...");
+
if (manager)
udev_ctrl_cleanup(manager->ctrl);
mac_selinux_finish();