aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2015-03-21 14:18:15 +0100
committerMax Kellermann <max@duempel.org>2015-03-21 14:27:54 +0100
commit7b575f61d0f5c34267fcfd60229d25edbcbe33da (patch)
treed6081306c6dc80dc889976b64201aaa7671da84c
parent400e3ea64960f9bcaf5ab83d7e1bea405bb5fc89 (diff)
downloadmpd-7b575f61d0f5c34267fcfd60229d25edbcbe33da.tar.gz
mpd-7b575f61d0f5c34267fcfd60229d25edbcbe33da.tar.xz
mpd-7b575f61d0f5c34267fcfd60229d25edbcbe33da.zip
Main: notify systemd when MPD is ready
Diffstat (limited to '')
-rw-r--r--src/Main.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/Main.cxx b/src/Main.cxx
index 9b7679369..713701e6e 100644
--- a/src/Main.cxx
+++ b/src/Main.cxx
@@ -106,6 +106,10 @@
#include <glib.h>
#endif
+#ifdef ENABLE_SYSTEMD_DAEMON
+#include <systemd/sd-daemon.h>
+#endif
+
#include <stdlib.h>
#ifdef HAVE_LOCALE_H
@@ -662,6 +666,10 @@ static int mpd_main_after_fork(struct options options)
a huge value to allow the kernel to reduce CPU wakeups */
SetThreadTimerSlackMS(100);
+#ifdef ENABLE_SYSTEMD_DAEMON
+ sd_notify(0, "READY=1");
+#endif
+
/* run the main loop */
instance->event_loop->Run();