#!/bin/sh # # compassd-progress-updated Compass progress update daemon ################################## # LSB header ### BEGIN INIT INFO # Provides: compass progress updated # Required-Start: $network $httpd # Default-Start: 3 4 5 # Default-Stop: 0 1 2 6 # Short-Description: compassd # Description: Compass daemon service # ### END INIT INFO # chkconfig header # chkconfig: 345 99 99 # description: This is a daemon that provides Compass daemon service # # Checking Sanity DEBIAN=/etc/debian_version SUSE=/etc/SuSE-release if [ -f $DEBIAN ]; then . /lib/lsb/init-functions elif [ -f $SUSE -a -r /etc/rc.status ]; then . /etc/rc.status else . /etc/rc.d/init.d/functions fi RETVAL=0 start() { echo -n "Starting Compass progress updated: " if [ -f $SUSE ]; then startproc -f -p /var/run/progress_update.pid -l /tmp/progress_update.log /opt/compass/bin/progress_update.py rc_status -v RETVAL=$? elif [ -f $DEBIAN ]; then start_daemon -p /var/run/progress_update.pid "/opt/compass/bin/progress_update.py &>/tmp/progress_update.log & echo \$! > /var/run/progress_update.pid" RETVAL=$? else daemon --pidfile /var/run/progress_update.pid "/opt/compass/bin/progress_update.py &>/tmp/progress_update.log & echo \$! > /var/run/progress_update.pid" RETVAL=$? fi echo } stop() { echo -n "Stopping Compass progress updated: " if [ -f $SUSE ]; then killproc -t 10 -p /var/run/progress_update.pid progress_updated rc_status -v RETVAL=$? elif [ -f $DEBIAN ]; then killproc -p /var/run/progress_update.pid progress_updated -TERM RETVAL=$? else killproc -p /var/run/progress_update.pid -d 30 progress_updated RETVAL=$? fi echo } restart() { stop start } case "$1" in start|stop|restart) $1 ;; status) echo -n "Checking compass progress_updated: " if [ -f $SUSE ]; then checkproc -v -p /var/run/progress_update.pid progress_updated rc_status -v RETVAL=$? elif [ -f $DEBIAN ]; then status_of_proc -p /var/run/progress_update.pid progress_updated RETVAL=$? else status -p /var/run/progress_update.pid progress_updated RETVAL=$? fi ;; *) echo "Usage: $0 {start|stop|status|restart}" exit 1 ;; esac exit $RETVAL