From c42f6907fa5f1cafcb5aedafe4fc9865d0b3fb4a Mon Sep 17 00:00:00 2001 From: Alex Suykov Date: Sat, 23 May 2015 13:06:55 +0300 Subject: [PATCH] pulseaudio: systemd support [Thomas: - use relative path for the service symlink - slightly adjust the service description] Signed-off-by: Alex Suykov Signed-off-by: Thomas Petazzoni --- package/pulseaudio/pulseaudio.mk | 8 ++++++++ package/pulseaudio/pulseaudio.service | 11 +++++++++++ 2 files changed, 19 insertions(+) create mode 100644 package/pulseaudio/pulseaudio.service diff --git a/package/pulseaudio/pulseaudio.mk b/package/pulseaudio/pulseaudio.mk index e68ca685c3..0fcfe38f92 100644 --- a/package/pulseaudio/pulseaudio.mk +++ b/package/pulseaudio/pulseaudio.mk @@ -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 index 0000000000..fc82f03392 --- /dev/null +++ b/package/pulseaudio/pulseaudio.service @@ -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 -- 2.30.2