VirtualBox

Changeset 32549 in vbox


Ignore:
Timestamp:
Sep 16, 2010 11:30:20 AM (14 years ago)
Author:
vboxsync
Message:

Solaris/Installer: vboxconfig.sh, checkinstall.sh cleanup.

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

Legend:

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

    r32388 r32549  
    1717#
    1818
     19infoprint()
     20{
     21    echo 1>&2 "$1"
     22}
     23
     24errorprint()
     25{
     26    echo 1>&2 "## $1"
     27}
     28
    1929abort_error()
    2030{
    21     echo "## Please close all VirtualBox processes and re-run this installer."
     31    errorprint "Please close all VirtualBox processes and re-run this installer."
     32    errorprint "Note: It can take up to 10 seconds for all VirtualBox & related processes to close."
    2233    exit 1
    2334}
     
    2839fi
    2940
    30 # Check if VBoxSVC is currently running
    31 VBOXSVC_PID=`ps -eo pid,fname | grep VBoxSVC | grep -v grep | awk '{ print $1 }'`
    32 if test ! -z "$VBOXSVC_PID" && test "$VBOXSVC_PID" -ge 0; then
    33     echo "## VirtualBox's VBoxSVC (pid $VBOXSVC_PID) still appears to be running."
    34     abort_error
    35 fi
    36 
    3741# Check if the Zone Access service is holding open vboxdrv, if so stop & remove it
    3842servicefound=`svcs -H "svc:/application/virtualbox/zoneaccess" 2> /dev/null | grep '^online'`
    3943if test ! -z "$servicefound"; then
    40     echo "## VirtualBox's zone access service appears to still be running."
    41     echo "## Halting & removing zone access service..."
     44    infoprint "VirtualBox's zone access service appears to still be running."
     45    infoprint "Halting & removing zone access service..."
    4246    /usr/sbin/svcadm disable -s svc:/application/virtualbox/zoneaccess
    4347    # Don't delete the service, handled by manifest class action
     
    4852servicefound=`svcs -H "svc:/application/virtualbox/webservice" 2> /dev/null | grep '^online'`
    4953if test ! -z "$servicefound"; then
    50     echo "## VirtualBox web service appears to still be running."
    51     echo "## Halting & removing webservice..."
     54    infoprint "VirtualBox web service appears to still be running."
     55    infoprint "Halting & removing webservice..."
    5256    /usr/sbin/svcadm disable -s svc:/application/virtualbox/webservice
    5357    # Don't delete the service, handled by manifest class action
    5458    # /usr/sbin/svccfg delete svc:/application/virtualbox/webservice
     59fi
     60
     61# Check if VBoxSVC is currently running
     62VBOXSVC_PID=`ps -eo pid,fname | grep VBoxSVC | grep -v grep | awk '{ print $1 }'`
     63if test ! -z "$VBOXSVC_PID" && test "$VBOXSVC_PID" -ge 0; then
     64    errorprint "VirtualBox's VBoxSVC (pid $VBOXSVC_PID) still appears to be running."
     65    abort_error
     66fi
     67
     68# Check if VBoxNetDHCP is currently running
     69VBOXNETDHCP_PID=`ps -eo pid,fname | grep VBoxNetDHCP | grep -v grep | awk '{ print $1 }'`
     70if test ! -z "VBOXNETDHCP_PID" && test "VBOXNETDHCP_PID" -ge 0; then
     71    errorprint "VirtualBox's VBoxNetDHCP (pid $VBOXNETDHCP_PID) still appears to be running."
     72    abort_error
    5573fi
    5674
     
    6078    vboxnetup=`$BIN_IFCONFIG vboxnet0 >/dev/null 2>&1`
    6179    if test "$?" -eq 0; then
    62         echo "## VirtualBox NetAdapter is still plumbed"
    63         echo "## Trying to remove old NetAdapter..."
     80        infoprint "VirtualBox NetAdapter is still plumbed"
     81        infoprint "Trying to remove old NetAdapter..."
    6482        $BIN_IFCONFIG vboxnet0 unplumb
    6583        if test "$?" -ne 0; then
    66             echo "## VirtualBox NetAdapter 'vboxnet0' couldn't be unplumbed (probably in use)."
     84            errorprint "VirtualBox NetAdapter 'vboxnet0' couldn't be unplumbed (probably in use)."
    6785            abort_error
    6886        fi
     
    7088    vboxnetup=`$BIN_IFCONFIG vboxnet0 inet6 >/dev/null 2>&1`
    7189    if test "$?" -eq 0; then
    72         echo "## VirtualBox NetAdapter (Ipv6) is still plumbed"
    73         echo "## Trying to remove old NetAdapter..."
     90        infoprint "VirtualBox NetAdapter (Ipv6) is still plumbed"
     91        infoprint "Trying to remove old NetAdapter..."
    7492        $BIN_IFCONFIG vboxnet0 inet6 unplumb
    7593        if test "$?" -ne 0; then
    76             echo "## VirtualBox NetAdapter 'vboxnet0' IPv6 couldn't be unplumbed (probably in use)."
     94            errorprint "VirtualBox NetAdapter 'vboxnet0' IPv6 couldn't be unplumbed (probably in use)."
    7795            abort_error
    7896        fi
  • trunk/src/VBox/Installer/solaris/vboxconfig.sh

    r32431 r32549  
    4242BIN_SVCS=/usr/bin/svcs
    4343BIN_ID=/usr/bin/id
     44BIN_PKILL=/usr/bin/pkill
    4445
    4546# "vboxdrv" is also used in sed lines here (change those as well if it ever changes)
     
    106107{
    107108    helpprint "VirtualBox Configuration Script"
    108     helpprint "usage: $0 operation [options]"
     109    helpprint "usage: $0 <operation> [options]"
    109110    helpprint
    110     helpprint "operation must be one of the following:"
    111     helpprint "  --postinstall           Perform full post installation procedure"
    112     helpprint "  --preremove             Perform full pre remove procedure"
    113     helpprint "  --installdrivers        Only install the drivers"
    114     helpprint "  --removedrivers         Only remove the drivers"
    115     helpprint "  --setupdrivers          Set up drivers, reloads any existing drivers"
     111    helpprint "<operation> must be one of the following:"
     112    helpprint "  --postinstall      Perform full post installation procedure"
     113    helpprint "  --preremove        Perform full pre remove procedure"
     114    helpprint "  --installdrivers   Only install the drivers"
     115    helpprint "  --removedrivers    Only remove the drivers"
     116    helpprint "  --setupdrivers     Setup drivers, reloads existing drivers"
    116117    helpprint
    117118    helpprint "[options] are one or more of the following:"
    118     helpprint "  --silent                Silent mode"
    119     helpprint "  --fatal                 Make failures fatal, don't continue"
    120     helpprint "  --ips                   An IPS package installation"
    121     helpprint "  --altkerndir            Use /usr/kernel/drv as the driver directory"
     119    helpprint "  --silent           Silent mode"
     120    helpprint "  --fatal            Don't continue on failure (required for postinstall)"
     121    helpprint "  --ips              This is an IPS package postinstall/preremove"
     122    helpprint "  --altkerndir       Use /usr/kernel/drv as the driver directory"
     123    helpprint
    122124}
    123125
     
    193195    if test ! -x "$BIN_IFCONFIG"; then
    194196        BIN_IFCONFIG=`find_bin_path "$BIN_IFCONFIG"`
     197    fi
     198
     199    if test ! -x "$BIN_PKILL"; then
     200        BIN_PKILL=`find_bin_path "$BIN_PKILL"`
    195201    fi
    196202}
     
    532538}
    533539
    534 # remove_all([fatal])
     540# remove_drivers([fatal])
    535541# failure: depends on [fatal]
    536542remove_drivers()
     
    627633    fi
    628634    return 1
     635}
     636
     637# stop_process(processname)
     638# failure: depends on [fatal]
     639stop_process()
     640{
     641    if test -z "$1"; then
     642        errorprint "missing argument to stop_process()"
     643        exit 1
     644    fi
     645
     646    procname=$1
     647    procpid=`ps -eo pid,fname | grep $PROC_NAME | grep -v grep | awk '{ print $1 }'`
     648    if test ! -z "procpid" && test "procpid" -ge 0; then
     649        $BIN_PKILL "$procname"
     650        sleep 2
     651        procpid=`ps -eo pid,fname | grep $PROC_NAME | grep -v grep | awk '{ print $1 }'`
     652        if test ! -z "procpid" && test "procpid" -ge 0; then
     653            subprint "Terminating: $procname  ...FAILED!"
     654            if test "$fatal" = "$FATALOP"; then
     655                exit 1
     656            fi
     657        else
     658            subprint "Terminated: $procname"
     659        fi
     660    fi
    629661}
    630662
     
    695727        inst=`expr $inst + 1`
    696728    done
     729
     730    # Stop our other daemons, non-fatal
     731    stop_process VBoxSVC
     732    stop_process VBoxNetDHCP
    697733}
    698734
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