diff options
author | Christian Hesse <mail@eworm.de> | 2017-01-06 10:06:14 +0100 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2017-01-06 10:06:14 +0100 |
commit | 6220ed0444b2855400339dfadb6e65364c1251dd (patch) | |
tree | 5ac8795a2cc00a667beb761b00c9c57b4bea59ea | |
parent | e65d190c78002ba77f0c3ec94ad744eb69e55ad0 (diff) | |
download | udev-block-notify-6220ed0444b2855400339dfadb6e65364c1251dd.tar.gz udev-block-notify-6220ed0444b2855400339dfadb6e65364c1251dd.tar.zst |
notify systemd on stop
-rw-r--r-- | udev-block-notify.c | 10 |
1 files changed, 10 insertions, 0 deletions
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; } |