VirtualBox

Changeset 32517 in vbox for trunk/src


Ignore:
Timestamp:
Sep 15, 2010 1:06:40 PM (14 years ago)
Author:
vboxsync
Message:

deb/rpm: fixed test for running VBoxSVC instances (don't execute _after_ upgrade); don't stop the vboxdrv module before we rebuild it (/etc/init.d/vboxdrv setup); do kill -USR1 only if vboxweb-service exists because this signal will terminate old VBoxSVC daemons unconditionally

Location:
trunk/src/VBox/Installer/linux
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Installer/linux/debian/postinst.in

    r32251 r32517  
    127127    update-rc.d vboxdrv defaults >/dev/null
    128128
    129     # There might be an old module active (e.g. manually loaded)
    130     if lsmod | grep -q "vboxdrv[^_-]"; then
    131       /etc/init.d/vboxdrv stop || true
    132     fi
    133 
    134129    BUILD_MODULES=0
    135130    REGISTER_MODULES=1
     
    163158    else
    164159      # shipped modules found, register sources at DKMS anyway
     160      if lsmod | grep -q "vboxdrv[^_-]"; then
     161        /etc/init.d/vboxdrv stop || true
     162      fi
    165163      if [ $REGISTER_MODULES -eq 1 ]; then
    166164        DKMS=`which dkms 2>/dev/null`
  • trunk/src/VBox/Installer/linux/rpm/VirtualBox.tmpl.spec

    r32487 r32517  
    144144[ -r /etc/default/virtualbox ] && . /etc/default/virtualbox
    145145
    146 # check for active VMs
     146# check for active VMs of the installed (old) package
    147147VBOXSVC_PID=`pidof VBoxSVC 2>/dev/null || true`
    148148if [ -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
    152156  sleep 1
    153157  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."
    157161    exit 1
    158162  fi
     
    292296  rm -f /lib/modules/*/misc/vboxnetadp.ko
    293297fi
    294 if lsmod | grep -q "vboxdrv[^_-]"; then
    295   /etc/init.d/vboxdrv stop || true
    296 fi
    297298if [ $BUILD_MODULES -eq 1 ]; then
    298299  /etc/init.d/vboxdrv setup || true
    299300else
     301  if lsmod | grep -q "vboxdrv[^_-]"; then
     302    /etc/init.d/vboxdrv stop || true
     303  fi
    300304  if [ $REGISTER_MODULES -eq 1 ]; then
    301305    DKMS=`which dkms 2>/dev/null`
     
    310314
    311315%preun
     316# $1==0: remove the last version of the package
     317# $1==1: install the first time
     318# $1>=2: upgrade
    312319%if %{?rpm_suse:1}%{!?rpm_suse:0}
    313320%stop_on_removal vboxweb-service
     
    322329fi
    323330%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
     332if [ "$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
    334344  fi
    335345fi
     
    363373%endif
    364374%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
    367376%insserv_cleanup
    368377%endif
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette