This ensures systemd knows when pulseaudio finishes loading, thus never
marking pulseaudio as active if startup fails.
pa_log_info("Daemon startup complete.");
+#ifdef HAVE_SYSTEMD_DAEMON
+ sd_notify(0, "READY=1");
+#endif
+
retval = 0;
if (pa_mainloop_run(mainloop, &retval) < 0)
goto finish;
pa_log_info("Daemon shutdown initiated.");
+#ifdef HAVE_SYSTEMD_DAEMON
+ sd_notify(0, "STOPPING=1");
+#endif
+
finish:
#ifdef HAVE_DBUS
if (server_bus)
Description=Sound Service
[Service]
+# Note that notify will only work if --daemonize=no
+Type=notify
ExecStart=@PA_BINARY@ --daemonize=no
Restart=on-failure