Complete debugging of uninstallation startup/shutdown name and

Thu, 02 Aug 2012 01:08:13 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 02 Aug 2012 01:08:13 +0200
changeset 443
37a0d0619cff
parent 442
b2db2cf97b30
child 444
59ebdf31607e

Complete debugging of uninstallation startup/shutdown name and
reimplement smf(5) service name preference in manifest.

openpkg/openpkg.spec file | annotate | diff | comparison | revisions
     1.1 --- a/openpkg/openpkg.spec	Thu Aug 02 00:16:26 2012 +0200
     1.2 +++ b/openpkg/openpkg.spec	Thu Aug 02 01:08:13 2012 +0200
     1.3 @@ -2695,16 +2695,17 @@
     1.4                  fi
     1.5                  ;;
     1.6              SunOS/5.1* )
     1.7 +                suname="`echo "$prefix" | sed -e 's;[^a-zA-Z0-9];;g'`"
     1.8                  if [ ! -d /var/svc/manifest/openpkg ]; then
     1.9                      mkdir /var/svc/manifest/openpkg
    1.10                  fi
    1.11 -                if [ ! -f /var/svc/manifest/openpkg/${prefix}.xml ]; then
    1.12 +                if [ ! -f /var/svc/manifest/openpkg/${suname}.xml ]; then
    1.13                      #   install SMF manifest
    1.14                      ( echo "<?xml version=\"1.0\"?>"
    1.15                        echo "<!DOCTYPE service_bundle SYSTEM \"/usr/share/lib/xml/dtd/service_bundle.dtd.1\">"
    1.16 -                      echo "<service_bundle type='manifest' name='OpenPKG:${prefix}'>"
    1.17 +                      echo "<service_bundle type='manifest' name='OpenPKG:${suname}'>"
    1.18                        echo "    <service"
    1.19 -                      echo "        name='openpkg/${prefix}'"
    1.20 +                      echo "        name='openpkg/${suname}'"
    1.21                        echo "        type='service'"
    1.22                        echo "        version='1'>"
    1.23                        echo "        <single_instance />"
    1.24 @@ -2767,7 +2768,7 @@
    1.25                        echo "            <propval"
    1.26                        echo "                name='action_authorization'"
    1.27                        echo "                type='astring'"
    1.28 -                      echo "                value='solaris.smf.manage.openpkg.${prefix}' />"
    1.29 +                      echo "                value='solaris.smf.manage.openpkg.${suname}' />"
    1.30                        echo "        </property_group>"
    1.31                        echo "        <instance name='default' enabled='false' />"
    1.32                        echo "        <stability value='Unstable' />"
    1.33 @@ -2778,10 +2779,10 @@
    1.34                        echo "        </template>"
    1.35                        echo "    </service>"
    1.36                        echo "</service_bundle>"
    1.37 -                    ) >/var/svc/manifest/openpkg/${prefix}.xml
    1.38 -                    chmod 644 /var/svc/manifest/openpkg/${prefix}.xml
    1.39 -                    /usr/sbin/svccfg import /var/svc/manifest/openpkg/${prefix}.xml
    1.40 -                    ( echo "/usr/sbin/svcadm enable \"svc:/openpkg/${prefix}:default\""
    1.41 +                    ) >/var/svc/manifest/openpkg/${suname}.xml
    1.42 +                    chmod 644 /var/svc/manifest/openpkg/${suname}.xml
    1.43 +                    /usr/sbin/svccfg import /var/svc/manifest/openpkg/${suname}.xml
    1.44 +                    ( echo "/usr/sbin/svcadm enable \"svc:/openpkg/${suname}:default\""
    1.45                      ) >%{l_prefix}.pre-post-process.sh
    1.46                  fi
    1.47                  ;;
    1.48 @@ -3509,7 +3510,7 @@
    1.49      fi
    1.50  
    1.51      #   remove the startup/shutdown transfer scripts
    1.52 -    name=`echo "$prefix" | sed -e 's;/;;g'`
    1.53 +    name="openpkg-`echo "$prefix" | sed -e 's;[^a-zA-Z0-9];;g'`"
    1.54      if [ ".$cusr" != ".root" ]; then
    1.55          echo "openpkg:WARNING: skipping deletion of system run-command hooks" 1>&2
    1.56          echo "openpkg:WARNING: (would require root-privileges)" 1>&2
    1.57 @@ -3586,9 +3587,10 @@
    1.58                  fi
    1.59                  ;;
    1.60              SunOS/5.1* )
    1.61 -                /usr/sbin/svcadm disable "svc:/openpkg/${prefix}:default"; sleep 2
    1.62 -                /usr/sbin/svccfg delete -f "svc:/openpkg/${prefix}:default" >/dev/null 2>&1 || true
    1.63 -                rm -f /var/svc/manifest/openpkg/${prefix}.xml >/dev/null 2>&1
    1.64 +                suname="`echo "$prefix" | sed -e 's;[^a-zA-Z0-9];;g'`"
    1.65 +                /usr/sbin/svcadm disable "svc:/openpkg/${suname}:default"; sleep 2
    1.66 +                /usr/sbin/svccfg delete -f "svc:/openpkg/${suname}:default" >/dev/null 2>&1 || true
    1.67 +                rm -f /var/svc/manifest/openpkg/${suname}.xml >/dev/null 2>&1
    1.68                  rmdir /var/svc/manifest/openpkg >/dev/null 2>&1 || true
    1.69                  ;;
    1.70              SunOS/5.* )

mercurial