- Timestamp:
- Sep 15, 2010 1:06:40 PM (14 years ago)
- Location:
- trunk/src/VBox/Installer/linux
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Installer/linux/debian/postinst.in
r32251 r32517 127 127 update-rc.d vboxdrv defaults >/dev/null 128 128 129 # There might be an old module active (e.g. manually loaded)130 if lsmod | grep -q "vboxdrv[^_-]"; then131 /etc/init.d/vboxdrv stop || true132 fi133 134 129 BUILD_MODULES=0 135 130 REGISTER_MODULES=1 … … 163 158 else 164 159 # shipped modules found, register sources at DKMS anyway 160 if lsmod | grep -q "vboxdrv[^_-]"; then 161 /etc/init.d/vboxdrv stop || true 162 fi 165 163 if [ $REGISTER_MODULES -eq 1 ]; then 166 164 DKMS=`which dkms 2>/dev/null` -
trunk/src/VBox/Installer/linux/rpm/VirtualBox.tmpl.spec
r32487 r32517 144 144 [ -r /etc/default/virtualbox ] && . /etc/default/virtualbox 145 145 146 # check for active VMs 146 # check for active VMs of the installed (old) package 147 147 VBOXSVC_PID=`pidof VBoxSVC 2>/dev/null || true` 148 148 if [ -n "$VBOXSVC_PID" ]; then 149 # try graceful termination; terminate the webservice first 150 /etc/init.d/vboxweb-service stop || true 151 kill -USR1 $VBOXSVC_PID 149 # executed before the new package is installed! 150 if [ -f /etc/init.d/vboxweb-service ]; then 151 # try graceful termination; terminate the webservice first 152 /etc/init.d/vboxweb-service stop 2>/dev/null || true 153 # ask the daemon to terminate immediately 154 kill -USR1 $VBOXSVC_PID 155 fi 152 156 sleep 1 153 157 if pidof VBoxSVC > /dev/null 2>&1; then 154 echo "A copy of VirtualBox is currently running. Please close it and try again. Please note"155 echo " that it can take up to ten seconds for VirtualBox (in particular the VBoxSVC daemon) to"156 echo " finish running."158 echo "A copy of VirtualBox is currently running. Please close it and try again." 159 echo "Please note that it can take up to ten seconds for VirtualBox (in particular" 160 echo "the VBoxSVC daemon) to finish running." 157 161 exit 1 158 162 fi … … 292 296 rm -f /lib/modules/*/misc/vboxnetadp.ko 293 297 fi 294 if lsmod | grep -q "vboxdrv[^_-]"; then295 /etc/init.d/vboxdrv stop || true296 fi297 298 if [ $BUILD_MODULES -eq 1 ]; then 298 299 /etc/init.d/vboxdrv setup || true 299 300 else 301 if lsmod | grep -q "vboxdrv[^_-]"; then 302 /etc/init.d/vboxdrv stop || true 303 fi 300 304 if [ $REGISTER_MODULES -eq 1 ]; then 301 305 DKMS=`which dkms 2>/dev/null` … … 310 314 311 315 %preun 316 # $1==0: remove the last version of the package 317 # $1==1: install the first time 318 # $1>=2: upgrade 312 319 %if %{?rpm_suse:1}%{!?rpm_suse:0} 313 320 %stop_on_removal vboxweb-service … … 322 329 fi 323 330 %endif 324 # check for active VMs 325 VBOXSVC_PID=`pidof VBoxSVC 2>/dev/null || true` 326 if [ -n "$VBOXSVC_PID" ]; then 327 kill -USR1 $VBOXSVC_PID 328 sleep 1 329 if pidof VBoxSVC > /dev/null 2>&1; then 330 echo "A copy of VirtualBox is currently running. Please close it and try again. Please note" 331 echo "that it can take up to ten seconds for VirtualBox (in particular the VBoxSVC daemon) to" 332 echo "finish running." 333 exit 1 331 332 if [ "$1" = 0 ]; then 333 # check for active VMs 334 VBOXSVC_PID=`pidof VBoxSVC 2>/dev/null || true` 335 if [ -n "$VBOXSVC_PID" ]; then 336 kill -USR1 $VBOXSVC_PID 337 sleep 1 338 if pidof VBoxSVC > /dev/null 2>&1; then 339 echo "A copy of VirtualBox is currently running. Please close it and try again." 340 echo "Please note that it can take up to ten seconds for VirtualBox (in particular" 341 echo "the VBoxSVC daemon) to finish running." 342 exit 1 343 fi 334 344 fi 335 345 fi … … 363 373 %endif 364 374 %if %{?rpm_suse:1}%{!?rpm_suse:0} 365 %restart_on_update vboxdrv 366 %restart_on_update vboxweb-service 375 %restart_on_update vboxdrv vboxweb-service 367 376 %insserv_cleanup 368 377 %endif
Note:
See TracChangeset
for help on using the changeset viewer.