VirtualBox

Ignore:
Timestamp:
Apr 21, 2021 12:27:22 PM (4 years ago)
Author:
vboxsync
Message:

testboxscript.xml service manifest has to be located permanent in /lib/svc/manifest/system for non solaris 10 versions. In solaris 11, the new service described in the manifest, will be added automatically by the command svcadm restart manifest-import

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/testboxscript/solaris/setup-routines.sh

    r82968 r88632  
    5454# Solaris variables.
    5555#
    56 MY_SVC_TMP="/tmp/testboxscript.xml"
    5756MY_SVC_FMRI="svc:/system/virtualbox/testboxscript"
    5857MY_SVCCFG="/usr/sbin/svccfg"
    5958MY_SVCADM="/usr/sbin/svcadm"
     59MY_CHGRP="/usr/bin/chgrp"
    6060MY_TR="/usr/bin/tr"
    6161MY_TAB=`printf "\t"`
     62
     63if test "${MY_SOLARIS_VER}" -lt 11; then
     64    # solaris 10 service import
     65    MY_SVC="/tmp/testboxscript.xml"
     66else
     67    # use propper manifest directory
     68    # /lib/svc/manifest/system for solaris 11 and higher for testboxscript.xml file
     69
     70    # Since sol 11.4 the solaris testboxscript service
     71    # generates Warnings in /var/svc/log/system-manifest-import:default.log
     72    # -------- Warning!!
     73    # Configuring services...
     74    # * Warning!! Importing Zone access service  ...FAILED.
     75
     76    MY_SVC="/lib/svc/manifest/system/testboxscript.xml"
     77fi
    6278if test "${MY_SOLARIS_VER}" -lt 11; then ## No gsed on S10?? ARG!
    6379    MY_SED="/usr/xpg4/bin/sed"
     
    202218
    203219    # Create the service xml config file.
    204     cat > "${MY_SVC_TMP}" <<EOF
     220    cat > "${MY_SVC}" <<EOF
    205221<?xml version='1.0'?>
    206222<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
     
    233249EOF
    234250    if [ "`uname -r`" = "5.10" ]; then # Seems to be gone in S11?
    235         cat >> "${MY_SVC_TMP}" <<EOF
     251        cat >> "${MY_SVC}" <<EOF
    236252            <dependency name='filesystem-volfs'  grouping='require_all' restart_on='none' type='service'>
    237253            <service_fmri value='svc:/system/filesystem/volfs:default' />
     
    239255EOF
    240256    fi
    241     cat >> "${MY_SVC_TMP}" <<EOF
     257    cat >> "${MY_SVC}" <<EOF
    242258        <!-- start + stop methods -->
    243259        <exec_method type='method' name='start' exec='${MY_SCREEN} -S testboxscript -d -m ${MY_ARGV}'
     
    268284EOF
    269285
    270     # Install the service, replacing old stuff.
    271     if "${MY_SVCCFG}" "export" "${MY_SVC_FMRI}" > /dev/null 2>&1; then
     286    if test "${MY_SOLARIS_VER}" -lt 11; then
     287      # Install the service, replacing old stuff.
     288      if "${MY_SVCCFG}" "export" "${MY_SVC_FMRI}" > /dev/null 2>&1; then
    272289        "${MY_SVCCFG}" "delete" "${MY_SVC_FMRI}"
    273     fi
    274     "${MY_SVCCFG}" "import" "${MY_SVC_TMP}"
    275     rm -f "${MY_SVC_TMP}"
     290      fi
     291      "${MY_SVCCFG}" "import" "${MY_SVC}"
     292
     293      # only for solaris version less than 11
     294      rm -f "${MY_SVC}"
     295    else
     296      "${MY_CHGRP}" "sys" "${MY_SVC}"
     297      "${MY_SVCADM}" "restart" "manifest-import"
     298
     299      # Do not remove the xml file in Solaris versions 11 and higher.
     300      # The service will be removed automatically, if the command
     301      # svcadm restart manifest-import
     302      # will be executed
     303
     304    fi
    276305    return 0;
    277306}
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