]> git.pld-linux.org Git - packages/pulseaudio.git/blobdiff - pulseaudio.init
- libatomic_ops is no longer included by devel headers
[packages/pulseaudio.git] / pulseaudio.init
index 56cbbda7dc751353c866ca91b7f67592d50fb54f..8994507a7d9c54f3a3e164c806aa0535ce80f41a 100644 (file)
 #
 # $Id$
 
-# Source function library
-. /etc/rc.d/init.d/functions
-
-# Get network config
-. /etc/sysconfig/network
-
 # Set defaults
 PULSEAUDIO_SYSTEM_START=0
 DISALLOW_MODULE_LOADING=1
@@ -26,50 +20,58 @@ DISALLOW_MODULE_LOADING=1
 [ -f /etc/sysconfig/pulseaudio ] && . /etc/sysconfig/pulseaudio
 [ "$PULSEAUDIO_SYSTEM_START" != "1" ] && exit 0
 
+# Source function library
+. /etc/rc.d/init.d/functions
+
+# Get network config
+. /etc/sysconfig/network
+
 start() {
        # Check if the service is already running?
-       if [ ! -f /var/lock/subsys/pulseaudio ]; then
-               msg_starting pulseaudio
-               daemon /usr/bin/pulseaudio --system --daemonize --high-priority --log-target=syslog --disallow-module-loading=$DISALLOW_MODULE_LOADING
-               RETVAL=$?
-               [ $RETVAL -eq 0 ] && touch /var/lock/subsys/pulseaudio
-       else
-               msg_already_running pulseaudio
+       if [ -f /var/lock/subsys/pulseaudio ]; then
+               msg_already_running "PulseAudio"
+               return
        fi
+
+       msg_starting "PulseAudio"
+       daemon /usr/bin/pulseaudio --system --daemonize --high-priority --log-target=syslog --disallow-module-loading=$DISALLOW_MODULE_LOADING
+       RETVAL=$?
+       [ $RETVAL -eq 0 ] && touch /var/lock/subsys/pulseaudio
 }
 
 stop() {
-       if [ -f /var/lock/subsys/pulseaudio ]; then
-               # Stop daemons.
-               msg_stopping pulseaudio
-               killproc pulseaudio
-               killproc --pidfile /var/run/pulse/pid pulseaudio -TERM
-               rm -f /var/lock/subsys/pulseaudio
-       else
-               msg_not_running pulseaudio
+       if [ ! -f /var/lock/subsys/pulseaudio ]; then
+               msg_not_running "PulseAudio"
+               return
        fi
+
+       # Stop daemons.
+       msg_stopping "PulseAudio"
+       killproc --pidfile /var/run/pulse/pid pulseaudio -TERM
+       rm -f /var/lock/subsys/pulseaudio
 }
 
 reload() {
-       if [ -f /var/lock/subsys/pulseaudio ]; then
-               msg_reloading pulseaudio
-               killproc pulseaudio -HUP
-               killproc --pidfile /var/run/pulse/pid pulseaudio -HUP
-               RETVAL=$?
-       else
-               msg_not_running pulseaudio
+       if [ ! -f /var/lock/subsys/pulseaudio ]; then
+               msg_not_running "PulseAudio"
                RETVAL=7
+               return
        fi
+
+       msg_reloading "PulseAudio"
+       killproc --pidfile /var/run/pulse/pid pulseaudio -HUP
+       RETVAL=$?
 }
 
 condrestart() {
-       if [ -f /var/lock/subsys/pulseaudio ]; then
-               stop
-               start
-       else
-               msg_not_running pulseaudio
+       if [ ! -f /var/lock/subsys/pulseaudio ]; then
+               msg_not_running "PulseAudio"
                RETVAL=$1
+               return
        fi
+
+       stop
+       start
 }
 
 RETVAL=0
@@ -88,15 +90,9 @@ case "$1" in
   try-restart)
        condrestart 0
        ;;
-# include force-reload here if program allows reloading without restart
-# otherwise remove reload action and support force-reload as restart if running
   reload|force-reload)
        reload
        ;;
-# use this one if program doesn't support reloading without restart
-  force-reload)
-       condrestart 7
-       ;;
   status)
        status pulseaudio
        RETVAL=$?
This page took 0.02817 seconds and 4 git commands to generate.