#!/bin/sh

VOLD=/usr/sbin/vold

test -x $VOLD || exit 0

case "$1" in
  start)
    echo "Starting vold"
    start-stop-daemon --start --exec $VOLD --pidfile /var/run/vold.pid 
    ;;
  stop)
    test -f /var/run/vold.pid || exit 0
    test -x /usr/bin/volq || exit 0
    echo "Stopping vold"
    /usr/bin/volq quit
    ;;
  restart|force-reload)
    # I must implement this---but i can't stop and restart!
    /usr/bin/volq quit
    start-stop-daemon --start --exec $VOLD --pidfile /var/run/vold.pid 
    ;;
  *)
    echo "Usage: /etc/init.d/vold {start|stop|restart|force-reload}"
    exit 1
esac

exit 0
