pcp
[Top] [All Lists]

[QA 1.1 PATCH]

To: PCP <pcp@xxxxxxxxxxx>
Subject: [QA 1.1 PATCH]
From: Alan Hoyt <ahoyt@xxxxxxxxxxxxx>
Date: Tue, 03 Jun 2003 16:35:16 -0500
Sender: pcp-bounce@xxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3) Gecko/20030312
more solaris related qa changes

- Alan -
--- common.check.orig   2003-02-13 10:51:36.000000000 +0000
+++ common.check        2003-06-03 21:32:58.320009000 +0000
@@ -780,7 +780,40 @@
            echo "_change_config: Error: cannot change config \"$1 $2\""
            exit 1
        fi
-    else
+    elif [ $PCP_PLATFORM = solaris ]
+    then
+       # if which chkconfig >/dev/null 2>&1
+       # then
+       # Try the Solaris way ..
+       #
+           case $1 
+           in
+               pmlogger)       pat=pcp
+                               ;;
+               pmcd)           pat=pcp
+                               ;;
+               pmie)           pat=pmie
+                               ;;
+               verbose)        pat=""
+                               ;;
+               *)              pat=$1
+                               ;;
+           esac
+           if [ $2 = on ]
+           then
+               . $PCP_SHARE_DIR/lib/rc-proc.sh -x
+               [ ! -z "$pat" ] && $sudo chkconfig_on $pat
+           elif [ $2 != on ]
+           then
+               [ ! -z "$pat" ] && $sudo chkconfig_off $pat
+           else
+               # I have no clue!
+               #
+               echo "_change_config: Error: cannot change config \"$1 $2\""
+               exit 1
+           fi
+      
+       else
        # Try the IRIX way
        #
        if which chkconfig >/dev/null 2>&1
@@ -834,7 +867,42 @@
            #
            echo unknown
        fi
-    else
+    elif [ $PCP_PLATFORM = solaris ]
+    then
+       if which chkconfig >/dev/null 2>&1
+       then
+           case $1 
+           in
+               pmlogger|pmcd)
+                               # both these IRIX chkconfig options map to
+                               # pcp for RedHat Linux
+                               pat=pcp
+                               ;;
+               verbose)
+                               pat=""
+                               ;;
+               *)              pat=$1
+                               ;;
+           esac
+           if [ -z "$pat" ]
+           then
+               # unconditionally "on", or no such option
+               #
+               echo on
+           else
+               if chkconfig $pat
+               then
+                   echo on
+               else
+                   echo off
+               fi
+           fi
+       else
+           # I have no clue!
+           #
+           echo unknown
+       fi
+   else
        # Try the IRIX way
        #
        if which chkconfig >/dev/null 2>&1
<Prev in Thread] Current Thread [Next in Thread>