vboxautostart-service.sh.in revision 73bef7f249418907cb1dc8dce51319772a3dbeee
#
# VirtualBox autostart service init script.
#
# Copyright (C) 2012 Oracle Corporation
#
# This file is part of VirtualBox Open Source Edition (OSE), as
# available from http://www.virtualbox.org. This file is free software;
# General Public License (GPL) as published by the Free Software
# Foundation, in version 2 as it comes in the "COPYING" file of the
# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
#
# chkconfig: 35 35 65
# description: VirtualBox autostart service
#
### BEGIN INIT INFO
# Provides: vboxautostart-service
# Required-Start: vboxdrv
# Required-Stop: vboxdrv
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Description: VirtualBox autostart service
### END INIT INFO
if [ -n "$INSTALL_DIR" ]; then
binary="$INSTALL_DIR/VBoxAutostart"
else
fi
# silently exit if the package was uninstalled but not purged,
# applies to Debian packages only
if [ -f /etc/redhat-release ]; then
elif [ -f /etc/SuSE-release ]; then
elif [ -f /etc/debian_version ]; then
elif [ -f /etc/gentoo-release ]; then
elif [ -f /etc/arch-release ]; then
elif [ -f /etc/slackware-version ]; then
elif [ -f /etc/lfs-release ]; then
else
fi
if [ -z "$NOLSB" ]; then
echo ""
log_failure_msg "$1"
}
log_success_msg " done."
}
log_daemon_msg "$@"
}
fi
if [ "$system" = "redhat" ]; then
if [ -n "$NOLSB" ]; then
usr="$1"
shift
}
echo
}
echo
}
echo -n "$1"
}
fi
fi
if [ "$system" = "suse" ]; then
usr="$1"
shift
}
if [ -n "$NOLSB" ]; then
rc_status -v
}
rc_status -v
}
echo -n "$1"
}
fi
fi
if [ "$system" = "debian" ]; then
usr="$1"
shift
bin="$1"
shift
}
}
if [ -n "$NOLSB" ]; then
echo " ...fail!"
}
echo " ...done."
}
echo -n "$1"
}
fi
fi
if [ "$system" = "gentoo" ]; then
if [ -f /sbin/functions.sh ]; then
. /sbin/functions.sh
fi
usr="$1"
shift
bin="$1"
shift
}
}
if [ -n "$NOLSB" ]; then
echo " ...fail!"
}
echo " ...done."
}
echo -n "$1"
}
shift
fi
fi
fi
if [ "$system" = "arch" ]; then
usr="$1"
shift
test $? -eq 0 && add_daemon rc.`basename $2`
}
killall $@
}
if [ -n "$NOLSB" ]; then
}
}
stat_busy "$1"
}
fi
fi
if [ "$system" = "slackware" ]; then
killall $1
}
if [ -n "$NOLSB" ]; then
echo " ...fail!"
}
echo " ...done."
}
echo -n "$1"
}
fi
usr="$1"
shift
}
fi
if [ "$system" = "lfs" ]; then
if [ -n "$NOLSB" ]; then
}
}
echo $1
}
fi
usr="$1"
shift
}
statusproc $1
}
fi
if [ "$system" = "other" ]; then
if [ -n "$NOLSB" ]; then
echo " ...fail!"
}
echo " ...done."
}
echo -n "$1"
}
fi
fi
}
vboxdrvrunning || {
fail_msg "VirtualBox kernel module not loaded!"
exit 0
}
PARAMS="--background --start"
# prevent inheriting this setting to VBoxSVC
unset VBOX_RELEASE_LOG_DEST
for user in `ls $VBOXAUTOSTART_DB/*.start`
do
done
return $RETVAL
}
stop() {
vboxdrvrunning || {
fail_msg "VirtualBox kernel module not loaded!"
exit 0
}
PARAMS="--stop"
# prevent inheriting this setting to VBoxSVC
unset VBOX_RELEASE_LOG_DEST
for user in `ls $VBOXAUTOSTART_DB/*.stop`
do
done
return $RETVAL
}
case "$1" in
;;
stop)
stop
;;
;;
;;
;;
;;
;;
*)
echo "Usage: $0 {start|stop}"
exit 1
esac
exit $RETVAL