wok view virtualbox-ose-guestutils/stuff/VBoxService @ rev 19260

Up cookutils (807)
author Aleksej Bobylev <al.bobylev@gmail.com>
date Sun Jul 03 15:10:16 2016 +0300 (2016-07-03)
parents 315d0dde6e3a
children
line source
1 #!/bin/sh
2 # /etc/init.d/VBoxService: Start, stop and restart VBoxService daemon on SliTaz,
3 # at boot time or with the command line. Daemons options are configured
4 # with /etc/daemons.conf
5 #
6 . /etc/init.d/rc.functions
7 . /etc/daemons.conf
9 NAME=VBoxService
10 DESC="$(_ 'VirtualBox Guest Service')"
11 DAEMON=/usr/bin/VBoxService
12 OPTIONS=$VBOXSERVICE_OPTIONS
13 PIDFILE=/var/run/VBoxService.pid
15 case "$1" in
16 start)
17 if active_pidfile $PIDFILE VBoxService ; then
18 _ '%s is already running.' $NAME
19 exit 1
20 fi
21 action 'Starting %s: %s...' "$DESC" $NAME
22 mkdir -p $(dirname $PIDFILE)
23 $DAEMON $OPTIONS
24 status ;;
25 stop)
26 if ! active_pidfile $PIDFILE VBoxService ; then
27 _ '%s is not running.'
28 exit 1
29 fi
30 action 'Stopping %s: %s...' "$DESC" $NAME
31 kill $(cat $PIDFILE)
32 rm $PIDFILE
33 status ;;
34 restart)
35 if ! active_pidfile $PIDFILE VBoxService ; then
36 _ '%s is not running.' $NAME
37 exit 1
38 fi
39 action 'Restarting %s: %s...' "$DESC" $NAME
40 kill $(cat $PIDFILE)
41 rm $PIDFILE
42 sleep 2
43 $DAEMON $OPTIONS
44 status ;;
45 *)
46 emsg "<n><b>$(_ 'Usage:')</b> $0 [start|stop|restart]"
47 newline
48 exit 1 ;;
49 esac
51 exit 0