Sisyphus repository
Last update: 21 october 2019 | SRPMs: 17508 | Visits: 15328583
en ru br
ALT Linux repos
S:5.2.30-alt1
5.0: 3.0.4-alt0.M50.1
4.1: 2.1.4-alt0.M41.5
4.0:
+backports:1.6.6-alt0.M40.2

Group :: Emulators
RPM: virtualbox

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

#!/bin/sh
#
# virtualbox Load/unload the VirtualBox (vboxdrv) kernel module.
#
# chkconfig: 345 90 10
# description: The virtualbox service handles loading and unloading of the \
# VirtalBox (vboxdrv) kernel module.

# Do not load RH compatibility interface.
WITHOUT_RC_COMPAT=1

# Source function library.
. /etc/init.d/functions

LOCKFILE=/var/lock/subsys/virtualbox
MODULENAME=vboxdrv
RETVAL=0

start()
{
action "Loading VirtualBox module ($MODULENAME):" modprobe $MODULENAME
RETVAL=$?
[ $RETVAL = 0 ] && touch "$LOCKFILE" ||:
return $RETVAL
}

stop()
{
action "Unloading VirtualBox module ($MODULENAME):" modprobe -r $MODULENAME
RETVAL=$?
[ $RETVAL = 0 ] && rm -f "$LOCKFILE" ||:
return $RETVAL
}

restart()
{
stop
start
}

status()
{
if /sbin/lsmod | grep -qs "^$MODULENAME[[:space:]]"; then
echo "$MODULENAME module is loaded"
return 0
elif [ -f "$LOCKFILE" ]; then
echo "$MODULENAME module is not loaded, but subsystem is locked"
return 2
else
echo "$MODULENAME service is stopped"
return 3
fi
}

# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
condstop)
if [ -e "$LOCKFILE" ]; then
stop
fi
;;
condrestart)
# Do nothing on package upgrade
;;
status)
status
RETVAL=$?
;;
*)
msg_usage "${0##*/} {start|stop|restart|condstop|condrestart|status}"
RETVAL=1
esac

exit $RETVAL
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin