[packages] openssh,pulseaudio: switch to new procd init script style
[openwrt/svn-archive/archive.git] / sound / pulseaudio / files / pulseaudio.init
index 6ad6af3c04f6472c45ddfd052f8d22743cb2cac6..4dbc5ecf5dab03ba491484294715b2db4e49a33e 100644 (file)
@@ -1,13 +1,13 @@
 #!/bin/sh /etc/rc.common
 # Copyright (C) 2011 OpenWrt.org
 
-START=65
-STOP=65
+START=99
+STOP=60
 
-SERVICE_USE_PID=1
-SERVICE_PID_FILE=/var/run/pulse/pid
+USE_PROCD=1
+PROG=/usr/bin/pulseaudio
 
-start() {
+start_service() {
        user_exists pulse 51 || user_add pulse 51
        group_exists pulse 51 || group_add pulse 51
        [ -d /var/run/pulse ] || {
@@ -20,12 +20,12 @@ start() {
                chmod 0750 /var/lib/pulse
                chown pulse:pulse /var/lib/pulse
        }
+
        chown root:pulse /dev/snd/* /dev/mixer /dev/dsp
        chmod 664 /dev/snd/* /dev/mixer /dev/dsp
 
-       service_start /usr/bin/pulseaudio --daemonize --system --disallow-exit --disallow-module-loading --disable-shm --exit-idle-time=-1
+       procd_open_instance
+       procd_set_param command $PROG --system --disallow-exit --disallow-module-loading --disable-shm --exit-idle-time=-1 --realtime=false
+       procd_close_instance
 }
 
-stop() {
-       service_stop /usr/bin/pulseaudio
-}