aboutsummaryrefslogtreecommitdiffstats
path: root/mpd-notification.c
diff options
context:
space:
mode:
Diffstat (limited to 'mpd-notification.c')
-rw-r--r--mpd-notification.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/mpd-notification.c b/mpd-notification.c
index 4e78e2e..d352c5f 100644
--- a/mpd-notification.c
+++ b/mpd-notification.c
@@ -511,6 +511,11 @@ nonotification:
if (verbose > 0)
printf("%s: Exiting...\n", program);
+ /* report stopping to systemd */
+#ifdef HAVE_SYSTEMD
+ sd_notify(0, "STOPPING=1\nSTATUS=Stopping...");
+#endif
+
rc = EXIT_SUCCESS;
out10:
@@ -531,5 +536,9 @@ out40:
if (ini != NULL)
iniparser_freedict(ini);
+#ifdef HAVE_SYSTEMD
+ sd_notify(0, "STATUS=Stopped. Bye!");
+#endif
+
return rc;
}