pulseaudio: systemd support
authorAlex Suykov <alex.suykov@gmail.com>
Sat, 23 May 2015 10:06:55 +0000 (13:06 +0300)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Tue, 14 Jul 2015 22:10:52 +0000 (00:10 +0200)
[Thomas:
 - use relative path for the service symlink
 - slightly adjust the service description]

Signed-off-by: Alex Suykov <alex.suykov@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
package/pulseaudio/pulseaudio.mk
package/pulseaudio/pulseaudio.service [new file with mode: 0644]

index e68ca685c34d8c41a8a8d03245030cebc552dfe4..0fcfe38f92b2278ab7626b584a770d070e76e49a 100644 (file)
@@ -123,6 +123,14 @@ define PULSEAUDIO_INSTALL_INIT_SYSV
                $(TARGET_DIR)/etc/init.d/S50pulseaudio
 endef
 
+define PULSEAUDIO_INSTALL_INIT_SYSTEMD
+       $(INSTALL) -D -m 644 package/pulseaudio/pulseaudio.service \
+               $(TARGET_DIR)/usr/lib/systemd/system/pulseaudio.service
+       mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
+       ln -sf ../../../../usr/lib/systemd/system/pulseaudio.service \
+               $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/pulseaudio.service
+endef
+
 endif
 
 $(eval $(autotools-package))
diff --git a/package/pulseaudio/pulseaudio.service b/package/pulseaudio/pulseaudio.service
new file mode 100644 (file)
index 0000000..fc82f03
--- /dev/null
@@ -0,0 +1,11 @@
+[Unit]
+Description=PulseAudio Sound System
+After=syslog.target
+
+[Service]
+UMask=077
+ExecStart=/usr/bin/pulseaudio --system --daemonize=no
+Restart=always
+
+[Install]
+WantedBy=multi-user.target