wok annotate virtualbox-ose-guestutils/stuff/VBoxService @ rev 16430

svkbd: fix version
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Apr 18 10:26:47 2014 +0000 (2014-04-18)
parents
children 7f188676b59c
rev   line source
monghitri@14054 1 #!/bin/sh
monghitri@14054 2 # /etc/init.d/VBoxService: Start, stop and restart VBoxService daemon on SliTaz,
monghitri@14054 3 # at boot time or with the command line. Daemons options are configured
monghitri@14054 4 # with /etc/daemons.conf
monghitri@14054 5 #
monghitri@14054 6 . /etc/init.d/rc.functions
monghitri@14054 7 . /etc/daemons.conf
monghitri@14054 8
monghitri@14054 9 NAME=VBoxService
monghitri@14054 10 DESC="VirtualBox Guest Service"
monghitri@14054 11 DAEMON=/usr/bin/VBoxService
monghitri@14054 12 OPTIONS=$VBOXSERVICE_OPTIONS
monghitri@14054 13 PIDFILE=/var/run/VBoxService.pid
monghitri@14054 14
monghitri@14054 15 case "$1" in
monghitri@14054 16 start)
monghitri@14054 17 if active_pidfile $PIDFILE VBoxService ; then
monghitri@14054 18 echo "$NAME already running."
monghitri@14054 19 exit 1
monghitri@14054 20 fi
monghitri@14054 21 echo -n "Starting $DESC: $NAME... "
monghitri@14054 22 mkdir -p $(dirname $PIDFILE)
monghitri@14054 23 $DAEMON $OPTIONS
monghitri@14054 24 status ;;
monghitri@14054 25 stop)
monghitri@14054 26 if ! active_pidfile $PIDFILE VBoxService ; then
monghitri@14054 27 echo "$NAME is not running."
monghitri@14054 28 exit 1
monghitri@14054 29 fi
monghitri@14054 30 echo -n "Stopping $DESC: $NAME... "
monghitri@14054 31 kill $(cat $PIDFILE)
monghitri@14054 32 rm $PIDFILE
monghitri@14054 33 status ;;
monghitri@14054 34 restart)
monghitri@14054 35 if ! active_pidfile $PIDFILE VBoxService ; then
monghitri@14054 36 echo "$NAME is not running."
monghitri@14054 37 exit 1
monghitri@14054 38 fi
monghitri@14054 39 echo -n "Restarting $DESC: $NAME... "
monghitri@14054 40 kill $(cat $PIDFILE)
monghitri@14054 41 rm $PIDFILE
monghitri@14054 42 sleep 2
monghitri@14054 43 $DAEMON $OPTIONS
monghitri@14054 44 status ;;
monghitri@14054 45 *)
monghitri@14054 46 echo ""
monghitri@14054 47 echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart]"
monghitri@14054 48 echo ""
monghitri@14054 49 exit 1 ;;
monghitri@14054 50 esac
monghitri@14054 51
monghitri@14054 52 exit 0