1 sage 1.1 #! /bin/sh
2 #
3 # Author: Markus Mueller <markus_mueller@de.ibm.com>
4 #
5 # /etc/init.d/pegasus
6 #
7 # and symbolic its link
8 #
9 # /usr/sbin/rcsshd
10 #
11 ### BEGIN INIT INFO
12 # Provides: pegasus
13 # Required-Start: $network
14 # Required-Stop: $network
15 # Default-Start: 3 5
16 # Default-Stop: 0 1 2 6
|
17 mike 1.3 # Description: Start the cimom daemon
|
18 sage 1.1 ### END INIT INFO
19
20 . /etc/rc.status
21 . /etc/rc.config
22
23 # Determine the base and follow a runlevel link name.
24 base=${0##*/}
25 link=${base#*[SK][0-9][0-9]}
26
27 # Force execution if not called by a runlevel directory.
28 test $link = $base && START_PEGASUS=yes
29 test "$START_PEGASUS" = yes || exit 0
30
31 # Shell functions sourced from /etc/rc.status:
32 # rc_check check and set local and overall rc status
33 # rc_status check and set local and overall rc status
34 # rc_status -v ditto but be verbose in local rc status
35 # rc_status -v -r ditto and clear the local rc status
36 # rc_failed set local and overall rc status to failed
37 # rc_reset clear local rc status (overall remains)
38 # rc_exit exit appropriate to overall rc status
39 sage 1.1
|
40 mike 1.3 export PEGASUS_HOME=/var/lib/pegasus
|
41 sage 1.1
42 # First reset status of this service
43 rc_reset
44 case "$1" in
45 start)
46 echo -n "Starting PEGASUS daemon"
47 ## Start daemon with startproc(8). If this fails
48 ## the echo return value is set appropriate.
49
|
50 mike 1.3 #startproc /usr/bin/cimserver
51 #export PEGASUS_HOME=/var/lib/pegasus
52 #handle that we cannot specify the location of the configuration
53 ln -sf /etc/pegasus/pegasus.conf /var/lib/pegasus/pegasus.conf
54 cimserver -D /var/lib/pegasus -d logdir=/var/pegasus/logs
|
55 sage 1.1
56 # Remember status and be verbose
57 rc_status -v
58 ;;
59 stop)
60 echo -n "Shutting down PEGASUS daemon:"
61 ## Stop daemon with killproc(8) and if this fails
62 ## set echo the echo return value.
63
|
64 mike 1.3 #killproc -INT /usr/bin/cimserver
|
65 sage 1.1 killall -2 cimserver
66
67 # Remember status and be verbose
68 rc_status -v
69 ;;
70 restart)
71 ## If first returns OK call the second, if first or
72 ## second command fails, set echo return value.
73 $0 stop && $0 start
74
75 # Remember status and be quiet
76 rc_status
77 ;;
78 reload)
79 echo -n "Reload service PEGASUS"
|
80 mike 1.3 #killproc -p /var/run/pegasus.pid -HUP /usr/bin/cimserver
|
81 sage 1.1 $0 stop && $0 start
82 #
83 rc_status -v
84 ;;
85 status)
86 echo -n "Checking for service PEGASUS: "
|
87 mike 1.3 checkproc /usr/bin/cimserver && echo OK || echo No process
|
88 sage 1.1 ;;
89 *)
90 echo "Usage: $0 {start|stop|status|restart|reload}"
91 exit 1
92 ;;
93 esac
94 rc_exit
|