]> git.pld-linux.org Git - packages/VirtualBox.git/blame - virtualbox.init
- start() doesn't have exit code
[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
22 msg_starting virtualbox
23 daemon --fork VBoxSVC
24 RETVAL=$?
25 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/virtualbox
26 else
27 msg_already_running virtualbox
28 fi
29}
30
31stop() {
32 if [ -f /var/lock/subsys/virtualbox ]; then
33 /sbin/rmmod vboxdrv >/dev/null 2>&1
34 # Stop daemons.
35 msg_stopping virtualbox
36 killproc VBoxSVC
37 rm -f /var/lock/subsys/virtualbox
38 else
39 msg_not_running virtualbox
40 fi
41}
42
43RETVAL=0
44# See how we were called.
45case "$1" in
46 start)
47 start
48 ;;
49 stop)
50 stop
51 ;;
52 restart)
53 stop
54 start
cef028c5 55 ;;
56 status)
57 status virtualbox
58 RETVAL=$?
59 ;;
60 *)
61 msg_usage "$0 {start|stop|restart|status}"
62 exit 3
63esac
64
65exit $RETVAL
This page took 0.038673 seconds and 4 git commands to generate.