install VBoxClient-all, drop xinitrc.d, assume modern desktop for autostart stuff
[packages/VirtualBox.git] / vboxservice.init
1 #!/bin/sh
2 #
3 # vboxservice   VirtualBox guest services
4 # chkconfig:    345 85 15
5 # description:  VirtualBox guest services
6 # processname:  VBoxService
7
8 # Source function library
9 . /etc/rc.d/init.d/functions
10
11 # Get service config - may override defaults
12 [ -f /etc/sysconfig/vboxservice ] && . /etc/sysconfig/vboxservice
13
14 start() {
15         # Check if the service is already running?
16         if [ -f /var/lock/subsys/vboxservice ]; then
17                 msg_already_running "VBox Service"
18                 return
19         fi
20
21         msg_starting "VBox Service"
22         daemon /usr/bin/VBoxService
23         RETVAL=$?
24         [ $RETVAL -eq 0 ] && touch /var/lock/subsys/vboxservice
25 }
26
27 stop() {
28         if [ ! -f /var/lock/subsys/vboxservice ]; then
29                 msg_not_running "VBox Service"
30                 return
31         fi
32
33         # Stop daemons.
34         msg_stopping "VBox Service"
35         killproc VBoxService
36         rm -f /var/lock/subsys/vboxservice
37 }
38
39 condrestart() {
40         if [ ! -f /var/lock/subsys/vboxservice ]; then
41                 msg_not_running "VBox Service"
42                 RETVAL=$1
43                 return
44         fi
45
46         stop
47         start
48 }
49
50 RETVAL=0
51 # See how we were called.
52 case "$1" in
53   start)
54         start
55         ;;
56   stop)
57         stop
58         ;;
59   restart)
60         stop
61         start
62         ;;
63   try-restart)
64         condrestart 0
65         ;;
66   force-reload)
67         condrestart 7
68         ;;
69   status)
70         status vboxservice VBoxService
71         RETVAL=$?
72         ;;
73   *)
74         msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
75         exit 3
76 esac
77
78 exit $RETVAL
This page took 0.039232 seconds and 3 git commands to generate.