VirtualBox

Changeset 56147 in vbox for trunk/src/VBox/Installer


Ignore:
Timestamp:
May 29, 2015 11:36:27 AM (10 years ago)
Author:
vboxsync
Message:

Solaris/Installer: checkinstall cleanup.

File:
1 edited

Legend:

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

    r56123 r56147  
    6464}
    6565
    66 # nothing to check for remote install
     66disable_service()
     67{
     68    if test -z "$1" || test -z "$2"; then
     69        errorprint "Missing argument to disable_service"
     70        return 1
     71    fi
     72    servicefound=`$BIN_SVCS -H "$1" 2> /dev/null | grep '^online'`
     73    if test ! -z "$servicefound"; then
     74        infoprint "$2 ($1) is still enabled. Disabling..."
     75        $BIN_SVCADM disable -s "$1"
     76        # Don't delete the service, handled by manifest class action
     77        # /usr/sbin/svccfg delete $1
     78    fi
     79}
     80
     81#
     82# Begin execution
     83#
     84
     85# Nothing to check for remote install
    6786REMOTE_INST=0
    6887if test "x${PKG_INSTALL_ROOT:=/}" != "x/"; then
     
    7190fi
    7291
    73 # nothing to check for non-global zones
     92# Nothing to check for non-global zones
    7493currentzone=`zonename`
    7594if test "$currentzone" != "global"; then
    7695    exit 0
    7796fi
    78 
    79 
    80 infoprint "Checking package dependencies..."
    8197
    8298PKG_MISSING_IPS=""
     
    84100BIN_PKGINFO=`which pkginfo 2> /dev/null`
    85101BIN_PKG=`which pkg 2> /dev/null`
     102BIN_SVCS=`which svcs 2> /dev/null`
     103BIN_SVCADM=/usr/sbin/svcadm
     104
     105# Check if our binaries are fine
     106if test ! -x "$BIN_SVCS"; then
     107    errorprint "Missing or non-executable binary: svcs ($BIN_SVCS)."
     108    exit 1
     109fi
     110if test ! -x "$BIN_SVCADM"; then
     111    errorprint "Missing or non-executable binary: svcadm ($BIN_SVCADM)."
     112    exit 1
     113fi
     114
     115infoprint "Checking package dependencies..."
    86116
    87117if test -x "$BIN_PKG"; then
     
    117147fi
    118148
    119 # nothing more to do for remote installs
     149# Nothing more to do for remote installs
    120150if test "$REMOTE_INST" -eq 1; then
    121151    exit 0
    122152fi
    123153
    124 # Check if the Zone Access service is holding open vboxdrv, if so stop & remove it
    125 servicefound=`svcs -H "svc:/application/virtualbox/zoneaccess" 2> /dev/null | grep '^online'`
    126 if test ! -z "$servicefound"; then
    127     infoprint "VirtualBox zone access service appears to still be running."
    128     infoprint "Halting & removing zone access service..."
    129     /usr/sbin/svcadm disable -s svc:/application/virtualbox/zoneaccess
    130     # Don't delete the service, handled by manifest class action
    131     # /usr/sbin/svccfg delete svc:/application/virtualbox/zoneaccess
    132 fi
    133 
    134 # Check if the Web service is running, if so stop & remove it
    135 servicefound=`svcs -H "svc:/application/virtualbox/webservice" 2> /dev/null | grep '^online'`
    136 if test ! -z "$servicefound"; then
    137     infoprint "VirtualBox web service appears to still be running."
    138     infoprint "Halting & removing webservice..."
    139     /usr/sbin/svcadm disable -s svc:/application/virtualbox/webservice
    140     # Don't delete the service, handled by manifest class action
    141     # /usr/sbin/svccfg delete svc:/application/virtualbox/webservice
    142 fi
    143 
    144 # Check if the autostart service is running, if so stop & remove it
    145 servicefound=`svcs -H "svc:/application/virtualbox/autostart" 2> /dev/null | grep '^online'`
    146 if test ! -z "$servicefound"; then
    147     infoprint "VirtualBox autostart service appears to still be running."
    148     infoprint "Halting & removing autostart service..."
    149     /usr/sbin/svcadm disable -s svc:/application/virtualbox/autostart
    150 fi
     154# Check & disable running services
     155disable_service "svc:/application/virtualbox/zoneaccess"  "VirtualBox zone access service"
     156disable_service "svc:/application/virtualbox/webservice"  "VirtualBox web service"
     157disable_service "svc:/application/virtualbox/autostart"   "VirtualBox auto-start service"
     158disable_service "svc:/application/virtualbox/balloonctrl" "VirtualBox balloon-control service"
    151159
    152160# Check if VBoxSVC is currently running
     
    203211# follow up fixes.
    204212for i in 1 2 3 4 5 6 7 8 9 10; do
    205     svcs -H "svc:/application/virtualbox/autostart"  >/dev/null 2>&1 ||
    206     svcs -H "svc:/application/virtualbox/webservice" >/dev/null 2>&1 ||
    207     svcs -H "svc:/application/virtualbox/zoneaccess" >/dev/null 2>&1 || break
     213    $BIN_SVCS -H "svc:/application/virtualbox/autostart"   >/dev/null 2>&1 ||
     214    $BIN_SVCS -H "svc:/application/virtualbox/webservice"  >/dev/null 2>&1 ||
     215    $BIN_SVCS -H "svc:/application/virtualbox/zoneaccess"  >/dev/null 2>&1 ||
     216    $BIN_SVCS -H "svc:/application/virtualbox/balloonctrl" >/dev/null 2>&1 || break
    208217    if test "${i}" = "1"; then
    209218        printf "Waiting for services from previous installation to be removed."
    210219    elif test "${i}" = "10"; then
    211         printf "\nWarning!!! Some service(s) still appears to not be removed completely!"
     220        printf "\nWarning!!! Some service(s) still appears to be present"
    212221    else
    213222        printf "."
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