From 6220ed0444b2855400339dfadb6e65364c1251dd Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 6 Jan 2017 10:06:14 +0100 Subject: notify systemd on stop --- udev-block-notify.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/udev-block-notify.c b/udev-block-notify.c index 32a761a..ee86208 100644 --- a/udev-block-notify.c +++ b/udev-block-notify.c @@ -307,6 +307,16 @@ int main (int argc, char ** argv) { } } + /* report stopping to systemd */ +#ifdef HAVE_SYSTEMD + sd_notify(0, "STOPPING=1\nSTATUS=Stopping..."); +#endif + udev_unref(udev); + +#ifdef HAVE_SYSTEMD + sd_notify(0, "STATUS=Stopped. Bye!"); +#endif + return EXIT_SUCCESS; } -- cgit v1.2.3-70-g09d2