From 9d20d5d463eaa5db33fcc04f95c48d1f2edd0363 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 6 Jan 2017 10:00:43 +0100 Subject: notify systemd on stop --- pacredir.c | 5 +++++ 1 file changed, 5 insertions(+) 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; } -- cgit v1.2.3-70-g09d2