]> git.pld-linux.org Git - packages/VirtualBox.git/blame - virtualbox.init
- proper group deps (NOTE: PLD-doc/BuildRequires.txt is your friend)
[packages/VirtualBox.git] / virtualbox.init
CommitLineData
cef028c5 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# Get service config - may override defaults
16[ -f /etc/sysconfig/virtualbox ] && . /etc/sysconfig/virtualbox
17
18start() {
19 # Check if the service is already running?
20 if [ ! -f /var/lock/subsys/virtualbox ]; then
21 _modprobe single die vboxdrv
29968f26 22 chown root.vbox /dev/vboxdrv
cef028c5 23 msg_starting virtualbox
24 daemon --fork VBoxSVC
25 RETVAL=$?
26 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/virtualbox
27 else
28 msg_already_running virtualbox
29 fi
30}
31
32stop() {
33 if [ -f /var/lock/subsys/virtualbox ]; then
34 /sbin/rmmod vboxdrv >/dev/null 2>&1
35 # Stop daemons.
36 msg_stopping virtualbox
37 killproc VBoxSVC
38 rm -f /var/lock/subsys/virtualbox
39 else
40 msg_not_running virtualbox
41 fi
42}
43
44RETVAL=0
45# See how we were called.
46case "$1" in
47 start)
48 start
49 ;;
50 stop)
51 stop
52 ;;
53 restart)
54 stop
55 start
cef028c5 56 ;;
57 status)
58 status virtualbox
59 RETVAL=$?
60 ;;
61 *)
62 msg_usage "$0 {start|stop|restart|status}"
63 exit 3
64esac
65
66exit $RETVAL
This page took 0.138173 seconds and 4 git commands to generate.