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