#!/sbin/runscript # Copyright 1999-2008 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: depend() { need localmount before xdm } start() { ebegin "Starting VirtualBox guest additions" # Check if vboxadd and vboxvfs module are already loaded if [[ -e /proc/modules && ! -e /dev/vboxadd ]] ; then einfo " Loading kernel modules and creating devices" /sbin/modprobe vboxadd &> /dev/null mknod /dev/vboxadd c 254 0 -m 0664 &> /dev/null /sbin/modprobe vboxvfs &> /dev/null fi einfo " Starting the time syncronization system service" start-stop-daemon --start --make-pidfile \ --exec /usr/sbin/vboxadd-timesync --pidfile /var/run/vboxadd-timesync.pid \ --name vboxadd-timesync \ --background eend $? "Failed to start VirtualBox guest additions" } stop() { ebegin "Stopping VirtualBox guest additions" einfo " Stopping the time syncronization system service" start-stop-daemon --stop --quiet \ --pidfile /var/run/vboxadd-timesync.pid --name vboxadd-timesync einfo " Unloading kernel modules and removing devices" /sbin/rmmod vboxvfs &> /dev/null /sbin/rmmod vboxadd &> /dev/null rm -f /dev/vboxadd &> /dev/null eend $? }