VirtualBox

Changeset 43799 in vbox


Ignore:
Timestamp:
Nov 2, 2012 5:02:10 PM (12 years ago)
Author:
vboxsync
Message:

Installer/Solaris: Refuse uninstallation if VBoxSVC is running.

File:
1 edited

Legend:

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

    r43452 r43799  
    787787}
    788788
     789# is_process_running(processname)
     790# returns 1 if the process is running, 0 otherwise
     791is_process_running()
     792{
     793    if test -z "$1"; then
     794        errorprint "missing argument to is_process_running()"
     795        exit 1
     796    fi
     797
     798    procname=$1
     799    procpid=`ps -eo pid,fname | grep $procname | grep -v grep | awk '{ print $1 }'`
     800    if test ! -z "$procpid" && test "$procpid" -ge 0; then
     801        return 1
     802    fi
     803    return 0
     804}
     805
     806
    789807# stop_process(processname)
    790808# failure: depends on [fatal]
     
    796814    fi
    797815
     816    # @todo use is_process_running()
    798817    procname=$1
    799818    procpid=`ps -eo pid,fname | grep $procname | grep -v grep | awk '{ print $1 }'`
     
    926945
    927946    # Stop our other daemons, non-fatal
    928     stop_process VBoxSVC
    929     stop_process VBoxNetDHCP
     947    stop_process "VBoxNetDHCP"
    930948}
    931949
     
    11141132{
    11151133    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
    11161141
    11171142    cleanup_install "$fatal"
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