]> granicus.if.org Git - sudo/commitdiff
Sync with git version
authorTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 17 Sep 2010 16:13:17 +0000 (12:13 -0400)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 17 Sep 2010 16:13:17 +0000 (12:13 -0400)
--HG--
branch : 1.7

pp

diff --git a/pp b/pp
index a997c0f4b7b5afecaac1ee111f802e12b43e3e14..22c050b61c6478c41aae3d5d3d51a21147f3c275 100755 (executable)
--- a/pp
+++ b/pp
@@ -1,6 +1,6 @@
 #!/bin/sh
 # (c) 2010 Quest Software, Inc. All rights reserved
-pp_revision="283"
+pp_revision="20100917"
  # Copyright 2010 Quest Software, Inc.  All rights reserved.
  #
  # Redistribution and use in source and binary forms, with or without
@@ -3032,6 +3032,14 @@ pp_backend_solaris () {
                 pp_solaris_install_service $_svc | pp_prepend $pp_wrkdir/postinstall
                 pp_prepend $pp_wrkdir/preremove <<-.
                     /etc/init.d/$_svc stop >/dev/null 2>/dev/null
+                    # Remove the service from SMF if present
+                    if [ "x${PKG_INSTALL_ROOT}" = 'x' ]; then
+                        if [ -x /usr/sbin/svcadm ] ; then
+                            # Likely un-needed, but just in case.
+                            /usr/sbin/svcadm disable -s $_svc 2>/dev/null
+                            /usr/sbin/svccfg delete $_svc 2>/dev/null
+                        fi
+                    fi
 .
             done
 
@@ -3427,6 +3435,43 @@ pp_solaris_make_service () {
     echo "#! /sbin/sh" >$out
     echo "#-- This service init file generated by polypkg" >>$out
 
+    #-- Start SMF integration.
+    if [ -n "$pp_svc_xml_file" ] ; then
+        cat <<_EOF >>$out
+if [ -x /usr/sbin/svcadm ] && [ "x\$1" != "xstatus" ] && [ "t\$QUEST_SMF_SERVICE" = "t" ] ; then
+    case "\$1" in
+        start)
+            echo "starting $svc"
+            /usr/sbin/svcadm clear svc:/quest/$svc:default >/dev/null 2>&1
+            /usr/sbin/svcadm enable -s quest/$svc
+            RESULT=\$?
+            if [ "\$RESULT" -ne 0 ] ; then
+                echo "Error \$RESULT starting $svc"
+                fi
+            ;;
+        stop)
+            echo "stopping $svc"
+            /usr/sbin/svcadm disable -ts quest/$svc
+            ;;
+        restart)
+            echo "restarting $svc"
+            /usr/sbin/svcadm disable -ts quest/$svc
+            /usr/sbin/svcadm clear svc:/quest/$svc:default >/dev/null 2>&1
+            /usr/sbin/svcadm enable -s quest/$svc
+            RESULT=\$?
+            if [ "\$RESULT" -ne 0 ] ; then
+                echo "Error \$RESULT starting $svc"
+                    fi
+                    ;;
+        *)
+            echo "Usage: /etc/init.d/$svc {start|stop|restart|status}"
+            exit 1
+    esac
+    exit 0
+fi
+_EOF
+    fi
+
     #-- construct a start command that builds a pid file as needed
     #   and forks the daemon
     _cmd="$cmd";
@@ -3534,7 +3579,6 @@ pp_solaris_install_service () {
     s="${solaris_sysv_init_start}$1"
     k="${solaris_sysv_init_kill}$1"
 
-    echo 'case " $SERVICES " in *" '$1' "*)'
     echo '
 if [ "x${PKG_INSTALL_ROOT}" != "x" ]; then
   if [ -x ${PKG_INSTALL_ROOT}/usr/sbin/svcadm ]; then
@@ -3577,8 +3621,9 @@ else
             echo "installf -c run \$PKGINST \$PKG_INSTALL_ROOT$l=../init.d/$1 s"
             pp_solaris_space /etc/rc$state.d 0 1
         done
-    echo " :;; esac"
-
+    echo '
+    fi
+fi'
 }
 
 pp_platforms="$pp_platforms deb"
@@ -6621,6 +6666,8 @@ CompressedSize 0
     )
 
        rm -rf $pp_wrkdir/bom_stage
+
+    hdiutil create -fs HFS+ -srcfolder $pkgdir -volname $name ${name}-${version}.dmg
 }
 
 pp_backend_macos_cleanup () {