prerm.in revision 5f721a465f007225fb7819245a4516263a6c9da2
#
# Copyright (C) 2006-2010 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 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.
#
# we can be called with the following arguments (6.5 of Debian policy):
# upgrade: (new version): upgrade to a new version
# failed-upgrade: (our version): failed to upgrade
# remove: (our version): remove this package
# purge: (our version): purge this package
# deconfigure: (our version): removing conflicting version
# defaults
if [ "$1" = "upgrade" -o "$1" = "remove" -o "$1" = "failed-upgrade" ]; then
db_version 2.0
# check for active VMs
VBOXSVC_PID=`pidof VBoxSVC 2>/dev/null`
if [ -n "$VBOXSVC_PID" ]; then
# try graceful termination; terminate the balloon control servic first
else
fi
# try graceful termination; terminate the webservice first
else
fi
kill -USR1 $VBOXSVC_PID
sleep 1
if [ "$1" != "failed-upgrade" ]; then
db_go || true
fi
exit 1
fi
fi
fi
# make sure we de-register the DMKS modules before the files get removed
if [ "$1" = "upgrade" -o "$1" = "remove" -o "$1" = "deconfigure" ]; then
if [ -n "$DKMS" ]; then
fi
fi
invoke-rc.d vboxdrv stop || exit $?
else
fi
fi
invoke-rc.d vboxnet stop || exit $?
else
fi
fi
#DEBHELPER#
exit 0