]> git.pld-linux.org Git - packages/VirtualBox-bin.git/blob - VirtualBox-vboxvfs.init
- cosmetics
[packages/VirtualBox-bin.git] / VirtualBox-vboxvfs.init
1 #!/bin/sh
2 #
3 # virtualbox    VirtualBox virtualizer for x86 hardware
4 #
5 # chkconfig:    345 84 25
6 #
7 # description:  InnoTek VirtualBox is a general-purpose full virtualizer for x86 
8 #               hardware. Targeted at server, desktop and embedded use.
9 #
10 # $Id$
11
12 # Source function library
13 . /etc/rc.d/init.d/functions
14
15 VBOX_DEVICE="/dev/vboxvfs"
16 VBOX_MODULE="vboxvfs"
17
18 # Get service config - may override defaults
19 [ -f /etc/sysconfig/virtualbox ] && . /etc/sysconfig/virtualbox
20
21 start() {
22         if [ ! -f /var/lock/subsys/vboxvfs ]; then
23                 modprobe -s $VBOX_MODULE
24                 # set proper /dev/vboxdrv for systems with static dev
25                 touch /var/lock/subsys/vboxvfs
26         fi
27 }
28
29 stop() {
30         # NOTE: rmmod will wait if device is in use, so automatic rmmod probably is not the best idea
31         /sbin/rmmod $VBOX_MODULE
32         rm -f /var/lock/subsys/vboxvfs
33 }
34
35 RETVAL=0
36 # See how we were called.
37 case "$1" in
38   start)
39         start
40         ;;
41   stop)
42         stop
43         ;;
44   restart)
45         stop
46         start
47         ;;
48   status)
49         if ! is_module $VBOX_MODULE; then
50                 echo "$VBOX_MODULE module is loaded"
51         else
52                 echo "$VBOX_MODULE module is not loaded"
53                 RETVAL=3
54         fi
55         ;;
56   *)
57         msg_usage "$0 {start|stop|restart|status}"
58         exit 3
59 esac
60
61 exit $RETVAL
This page took 0.0313 seconds and 3 git commands to generate.