1 martin 1.8 #//%LICENSE////////////////////////////////////////////////////////////////
|
2 martin 1.9 #//
|
3 martin 1.8 #// 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.9 #//
|
10 martin 1.8 #// 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.9 #//
|
17 martin 1.8 #// The above copyright notice and this permission notice shall be included
18 #// in all copies or substantial portions of the Software.
|
19 martin 1.9 #//
|
20 martin 1.8 #// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
21 martin 1.9 #// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
22 martin 1.8 #// 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.9 #//
|
28 martin 1.8 #//////////////////////////////////////////////////////////////////////////
|
29 karl 1.7 #! /bin/sh
|
30 martin 1.5 #//
31 #//%/////////////////////////////////////////////////////////////////////////////
|
32 w.otsuka 1.1
33 ### BEGIN INIT INFO
34 # Provides: tog-pegasus
35 # Required-Start: $syslog $network
|
36 w.otsuka 1.3 # Should-Start: $time
37 # Required-Stop: $syslog
|
38 w.otsuka 1.1 # Default-Start: 3 5
39 # Default-Stop: 0 1 2 6
|
40 w.otsuka 1.3 # Description: init script for Pegasus CIM server
|
41 w.otsuka 1.1 ### END INIT INFO
42
43 CIMSERVER_BIN=/opt/tog-pegasus/sbin/cimserver
44 prog=cimserver
45
46 test -x $CIMSERVER_BIN || exit 5
47
48 . /lib/lsb/init-functions
49 RETVAL=0
50
51 case "$1" in
52 start)
|
53 w.otsuka 1.3 echo -n $"Starting up CIM server: "
|
54 w.otsuka 1.4 $CIMSERVER_BIN
|
55 w.otsuka 1.1 RETVAL=$?
56 [ "$RETVAL" -eq 0 ] && log_success_msg $"$prog start" || log_failure_msg $"$prog start"
57 echo
58 ;;
59
60 stop)
|
61 w.otsuka 1.3 echo -n $"Shutting down CIM server: "
|
62 w.otsuka 1.2 killproc cimserver
|
63 w.otsuka 1.1 RETVAL=$?
64 [ "$RETVAL" -eq 0 ] && log_success_msg $"$prog stop" || log_failure_msg $"$prog stop"
65 echo
66 ;;
|
67 w.otsuka 1.3 status)
68 pid=`pidofproc $CIMSERVER_BIN`
|
69 w.otsuka 1.1 RETVAL=$?
|
70 w.otsuka 1.3 if [ "$RETVAL" -eq 0 ]; then
71 echo "CIM server is running"
72 else
73 echo "CIM server is not running"
74 fi
|
75 w.otsuka 1.1 ;;
|
76 w.otsuka 1.6 condrestart)
77 pid=`pidofproc $CIMSERVER_BIN`
78 RETVAL=$?
79 if [ "$RETVAL" -eq 0 ]; then
80 $0 stop && $0 start;
81 RETVAL=$?;
82 fi;
83 ;;
|
84 w.otsuka 1.1 try-restart)
85 $0 stop && $0 start
86 ;;
87 restart|force-reload)
88 $0 stop
89 $0 start
90 ;;
91 reload)
92 ;;
93 *)
94 echo "Usage: $0 {start|stop|status|restart|reload|force-reload|try-restart}"
95 exit 1
96 esac
97
98 exit $RETVAL
99
|