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 [ -e /etc/sysconfig/tog-pegasus ] && . /etc/sysconfig/tog-pegasus;
|
37 w.otsuka 1.1
38 . /lib/lsb/init-functions
39 RETVAL=0
40
41 case "$1" in
42 start)
|
43 kumpf 1.6 if [ ! -e ${PEGASUS_SSL_CONF_FILE} ] || [ ! -e ${PEGASUS_SSL_CERT_FILE} ] ||
|
44 w.otsuka 1.3 [ ! -e ${PEGASUS_SSL_KEY_FILE} ] || [ ! -e ${PEGASUS_SSL_TRUSTSTORE} ]; then
45 if [ -x $PEGASUS_SCRIPT_DIR/genOpenPegasusSSLCerts ]; then
46 echo -n "tog-pegasus: Generating cimserver SSL certificates...";
47 $PEGASUS_SCRIPT_DIR/genOpenPegasusSSLCerts;
48 if [ $? -eq 0 ]; then
49 echo "SSL certificates generated";
50 else
51 echo "SSL certificates failed";
52 fi;
53 echo;
54 fi;
55 fi;
56 echo -n $"Starting up CIM server: "
57 $CIMSERVER_BIN ${CIMSERVER_OPTIONS}
58 RETVAL=$?
|
59 w.otsuka 1.1 [ "$RETVAL" -eq 0 ] && log_success_msg $"$prog start" || log_failure_msg $"$prog start"
|
60 w.otsuka 1.3 echo;
|
61 w.otsuka 1.1 ;;
62
63 stop)
64 echo -n $"Shutting down CIM server: "
65 killproc cimserver
66 RETVAL=$?
67 [ "$RETVAL" -eq 0 ] && log_success_msg $"$prog stop" || log_failure_msg $"$prog stop"
68 echo
69 ;;
70 status)
71 pid=`pidofproc $CIMSERVER_BIN`
72 RETVAL=$?
73 if [ "$RETVAL" -eq 0 ]; then
|
74 w.otsuka 1.3 echo "CIM server ($pid) is running"
|
75 w.otsuka 1.1 else
76 echo "CIM server is not running"
77 fi
78 ;;
79 condrestart)
80 pid=`pidofproc $CIMSERVER_BIN`
81 RETVAL=$?
82 if [ "$RETVAL" -eq 0 ]; then
83 $0 stop && $0 start;
84 RETVAL=$?;
85 fi;
86 ;;
87 try-restart)
|
88 w.otsuka 1.3 $0 stop && $0 start;
|
89 w.otsuka 1.1 ;;
90 restart|force-reload)
|
91 w.otsuka 1.3 $0 stop;
92 $0 start;
|
93 w.otsuka 1.1 ;;
94 reload)
95 ;;
96 *)
97 echo "Usage: $0 {start|stop|status|restart|reload|force-reload|try-restart}"
98 exit 1
99 esac
100
101 exit $RETVAL
102
|