#!/bin/bash
#
# system-tools-backends: System Tools Backends
#
# chkconfig: 345 26 64
#
# description: system-tools-backends is a daemon for system administration
#              It is controlled by the programs in gnome-system-tools 

# Source function library.
. /etc/init.d/functions

prog="System Tools Backends"
DAEMON=/usr/sbin/system-tools-backends
NAME=system-tools-backends

start() {
    echo -n $"Starting $prog: "
    $DAEMON -D
    RETVAL=$?
    [ $RETVAL = 0 ] && touch /var/lock/subsys/$NAME && success || failure
    echo
    return $RETVAL
}

stop() {
    echo -n $"Stopping $prog: "
    killproc $NAME
    RETVAL=$?
    if [ $RETVAL -eq 0 ] ; then
        rm -f /var/lock/subsys/$NAME 
    fi
    echo
    return $RETVAL
}

restart() {
    stop
    start
}

condrestart() {
    if test "x`pidof $NAME`" != x; then
        stop
        start
    fi
}

RETVAL=0

# See how we were called.
case "$1" in
    start)
        start
        ;;
    stop)
        stop
        ;;
    status)
        status $NAME
        ;;
    restart)
        restart
        ;;
    condrestart)
        condrestart
        ;;
    *)
        echo $"Usage: $0 {start|stop|status|restart}"
        exit 1
esac

exit $?
