(file) Return to commands-tog-pegasus.rc CVS log (file) (dir) Up to [Pegasus] / pegasus / rpm

  1 martin 1.4 #//%LICENSE////////////////////////////////////////////////////////////////
  2 martin 1.5 #//
  3 martin 1.4 #// Licensed to The Open Group (TOG) under one or more contributor license
  4            #// agreements.  Refer to the OpenPegasusNOTICE.txt file distributed with
  5            #// this work for additional information regarding copyright ownership.
  6            #// Each contributor licenses this file to you under the OpenPegasus Open
  7            #// Source License; you may not use this file except in compliance with the
  8            #// License.
  9 martin 1.5 #//
 10 martin 1.4 #// Permission is hereby granted, free of charge, to any person obtaining a
 11            #// copy of this software and associated documentation files (the "Software"),
 12            #// to deal in the Software without restriction, including without limitation
 13            #// the rights to use, copy, modify, merge, publish, distribute, sublicense,
 14            #// and/or sell copies of the Software, and to permit persons to whom the
 15            #// Software is furnished to do so, subject to the following conditions:
 16 martin 1.5 #//
 17 martin 1.4 #// The above copyright notice and this permission notice shall be included
 18            #// in all copies or substantial portions of the Software.
 19 martin 1.5 #//
 20 martin 1.4 #// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 21 martin 1.5 #// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 22 martin 1.4 #// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 23            #// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
 24            #// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
 25            #// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
 26            #// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 27 martin 1.5 #//
 28 martin 1.4 #//////////////////////////////////////////////////////////////////////////
 29 w.otsuka 1.1 prog=cimserver
 30              
 31 w.otsuka 1.3 if [ ! -x $CIMSERVER_BIN ]; then
 32                  echo -n "tog-pegasus $1: $CIMSERVER_BIN not found or not executable.";
 33                  exit 1;
 34              fi;
 35              
 36 s.kodali 1.7 [ -e /etc/sysconfig/${PEGASUS_FLAVOR}-pegasus ] && . /etc/sysconfig/${PEGASUS_FLAVOR}-pegasus;
 37 w.otsuka 1.1 
 38 dev.meetei 1.8.4.1 if [ -e /lib/lsb/init-functions ]; then
 39 w.otsuka   1.1     . /lib/lsb/init-functions
 40 dev.meetei 1.8.4.1 else
 41                        . /etc/init.d/functions
 42                        log_success_msg() {
 43                            echo -n $*
 44                            success "$*"
 45                            echo
 46                        }
 47                        log_failure_msg() {
 48                            echo -n $*
 49                            failure "$*"
 50                            echo
 51                        }
 52                    fi
 53                    
 54 w.otsuka   1.1     RETVAL=0
 55                    
 56                    case "$1" in
 57                         start)
 58 kumpf      1.6     	if [ ! -e ${PEGASUS_SSL_CONF_FILE} ] || [ ! -e ${PEGASUS_SSL_CERT_FILE} ] ||
 59 w.otsuka   1.3     	   [ ! -e ${PEGASUS_SSL_KEY_FILE} ]  || [ ! -e ${PEGASUS_SSL_TRUSTSTORE} ]; then
 60                    	   if [ -x $PEGASUS_SCRIPT_DIR/genOpenPegasusSSLCerts ]; then
 61 s.kodali   1.8     	       echo -n "${PEGASUS_FLAVOR}-pegasus: Generating cimserver SSL certificates...";
 62 w.otsuka   1.3     	       $PEGASUS_SCRIPT_DIR/genOpenPegasusSSLCerts;
 63                    	       if [ $? -eq 0 ]; then
 64                    		   echo "SSL certificates generated";
 65                    	       else
 66                    		   echo "SSL certificates failed";
 67                    	       fi;
 68                    	       echo;
 69                    	   fi;
 70                    	fi;
 71                     	echo -n $"Starting up CIM server: "
 72                    	$CIMSERVER_BIN ${CIMSERVER_OPTIONS}
 73                     	RETVAL=$?
 74 w.otsuka   1.1     	[ "$RETVAL" -eq 0 ] && log_success_msg $"$prog start" || log_failure_msg $"$prog start"
 75 w.otsuka   1.3     	echo;
 76 w.otsuka   1.1     	;;
 77                    
 78                         stop)
 79                    	echo -n $"Shutting down CIM server: "
 80 s.kodali   1.7     	killproc $CIMSERVER_BIN
 81 w.otsuka   1.1     	RETVAL=$?
 82                    	[ "$RETVAL" -eq 0 ] && log_success_msg $"$prog stop" || log_failure_msg $"$prog stop"
 83                    	echo
 84                    	;;
 85                         status)
 86                    	pid=`pidofproc $CIMSERVER_BIN`
 87                    	RETVAL=$?
 88                    	if [ "$RETVAL" -eq 0 ]; then
 89 w.otsuka   1.3     		echo "CIM server ($pid) is running"
 90 w.otsuka   1.1     	else
 91                    		echo "CIM server is not running"
 92                    	fi
 93                    	;;
 94                         condrestart)
 95                    	pid=`pidofproc $CIMSERVER_BIN`
 96                    	RETVAL=$?
 97                    	if [ "$RETVAL" -eq 0 ]; then
 98                    	    $0 stop && $0 start;
 99                    	    RETVAL=$?;
100                    	fi;
101                            ;;
102                         try-restart)
103 w.otsuka   1.3     	$0 stop && $0 start;
104 w.otsuka   1.1     	;;
105                         restart|force-reload)
106 w.otsuka   1.3     	$0 stop;
107                    	$0 start;
108 w.otsuka   1.1     	;;
109                         reload)
110                    	;;
111                         *)
112                    	echo "Usage: $0 {start|stop|status|restart|reload|force-reload|try-restart}"
113                    	exit 1
114                    esac
115                    
116                    exit $RETVAL
117                    

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2