summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2017-01-06 10:00:43 +0100
committerGravatar Christian Hesse <mail@eworm.de>2017-01-06 10:00:43 +0100
commit9d20d5d463eaa5db33fcc04f95c48d1f2edd0363 (patch)
treee3ef2e17473890dc24244f7bd645af6adf4b6936
parent48ce76c01af56785aeb2fb550d578d992e3394d8 (diff)
downloadpacredir-9d20d5d463eaa5db33fcc04f95c48d1f2edd0363.tar.gz
pacredir-9d20d5d463eaa5db33fcc04f95c48d1f2edd0363.tar.zst
notify systemd on stop
-rw-r--r--pacredir.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/pacredir.c b/pacredir.c
index 6284a38..0ea9e55 100644
--- a/pacredir.c
+++ b/pacredir.c
@@ -726,6 +726,9 @@ int main(int argc, char ** argv) {
/* run the main loop */
avahi_simple_poll_loop(simple_poll);
+ /* report stopping to systemd */
+ sd_notify(0, "STOPPING=1\nSTATUS=Stopping...");
+
/* stop http server */
MHD_stop_daemon(mhd);
@@ -763,6 +766,8 @@ fail:
if (simple_poll)
avahi_simple_poll_free(simple_poll);
+ sd_notify(0, "STATUS=Stopped. Bye!");
+
return ret;
}