VirtualBox

Ignore:
Timestamp:
May 24, 2012 3:56:28 PM (13 years ago)
Author:
vboxsync
Message:

Additions/solaris: Fixed automatic starting of VBoxService.

File:
1 edited

Legend:

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

    r41027 r41438  
    408408    /usr/sbin/devfsadm -i vboxguest
    409409
    410     # Setup our VBoxService SMF service
    411     echo "Configuring service..."
    412     /usr/sbin/svcadm restart svc:/system/manifest-import:default
    413     /usr/sbin/svcadm enable -s virtualbox/vboxservice
     410    # Setup VBoxService & start the service automatically
     411    echo "Configuring service (this might take a while)..."
     412    cmax=32
     413    cslept=0
     414    success=0
     415    sync
     416
     417    # Since S11 the way to import a manifest is via restarting manifest-import which is asynchronous and can
     418    # take a while to complete, using disable/enable -s doesn't work either. So we restart it, and poll in
     419    # 1 second intervals to see if our service has been successfully imported and timeout after 'cmax' seconds.
     420    /usr/sbin/svcadm restart svc:system/manifest-import:default
     421    is_import=`/usr/bin/svcs virtualbox/vboxservice >/dev/null 2>&1`
     422    while test $? -ne 0;
     423    do
     424        sleep 1
     425        cslept=`expr $cslept + 1`
     426        if test "$cslept" -eq "$cmax"; then
     427            success=1
     428            break
     429        fi
     430        is_import=`/usr/bin/svcs virtualbox/vboxservice >/dev/null 2>&1`
     431    done
     432    if test "$success" -eq 0; then
     433        echo "Enabling service..."
     434        /usr/sbin/svcadm enable -s virtualbox/vboxservice
     435    else
     436        echo "## VBoxService import failed."
     437        echo "## See /var/svc/log/system-manifest-import:default.log for details."
     438        # Exit as partially failed installation
     439        retval=2
     440    fi
    414441
    415442    # Update boot archive
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