VirtualBox

Changeset 43800 in vbox


Ignore:
Timestamp:
Nov 5, 2012 12:30:48 PM (12 years ago)
Author:
vboxsync
Message:

Solaris/Installer: Check for VMs still hanging about after killing VBoxSVC and refuse uninstallation.
Also kill VBoxSVC using SIGUSR1 rather than pkill. SIGUSR1 terminates VBoxSVC quicker.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Installer/solaris/vboxconfig.sh

    r43799 r43800  
    946946    # Stop our other daemons, non-fatal
    947947    stop_process "VBoxNetDHCP"
     948
     949   # Stop VBoxSVC quickly using SIGUSR1
     950    procname="VBoxSVC"
     951    procpid=`ps -eo pid,fname | grep $procname | grep -v grep | awk '{ print $1 }'`
     952    if test ! -z "$procpid" && test "$procpid" -ge 0; then
     953        kill -USR1 $procpid
     954
     955        # Sleep a while and check if VBoxSVC is still running, if so fail uninstallation.
     956        sleep 2
     957        is_process_running "VBoxSVC"
     958        if test "$?" -eq 1; then
     959            errorprint "Cannot uninstall VirtualBox while VBoxSVC (pid $procpid) is still running."
     960            errorprint "Please shutdown all VMs and VirtualBox frontends before uninstalling VirtualBox."
     961            exit 1
     962        fi
     963
     964        # Some VMs might still be alive after VBoxSVC as they poll less frequently before killing themselves
     965        # Just check for VBoxHeadless & VirtualBox frontends for now.
     966        is_process_running "VBoxHeadless"
     967        if test "$?" -eq 1; then
     968            errorprint "Cannot uninstall VirtualBox while VBoxHeadless is still running."
     969            errorprint "Please shutdown all VMs and VirtualBox frontends before uninstalling VirtualBox."
     970            exit 1
     971        fi
     972
     973        is_process_running "VirtualBox"
     974        if test "$?" -eq 1; then
     975            errorprint "Cannot uninstall VirtualBox while any VM is still running."
     976            errorprint "Please shutdown all VMs and VirtualBox frontends before uninstalling VirtualBox."
     977            exit 1
     978        fi
     979    fi
    948980}
    949981
     
    11321164{
    11331165    fatal=$1
    1134 
    1135     is_process_running "VBoxSVC"
    1136     if test "$?" -eq 1; then
    1137         errorprint "Cannot uninstall VirtualBox while VBoxSVC is still running."
    1138         errorprint "Please shutdown all VMs and VirtualBox frontends before uninstalling VirtualBox."
    1139         exit 1
    1140     fi
    1141 
     1166   
    11421167    cleanup_install "$fatal"
    11431168
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