summaryrefslogtreecommitdiff
blob: 4684773a8520e96f40f006d114e1d0e6ca865b70 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
#!/sbin/runscript
#
# dellomsa-daemons
#
#           Dell OMSA daemons startup script
#
#	    This script takes care of starting OMSA daemons:
#	    - data engine
#	    - instrumentation (event syslog'ing) service
#	    - OM common services
#	    - racsvc
#	    - snmp service
#	    - omawsd (TODO, have to figure out how to get it working)
#

BITS=32
## Source any dependent configuration here and set variables
##
# omsad
. /etc/sysconfig/omsad.src
OMSAD=${PROGRAM_PATH}/${PROGRAM_BIN}${BITS}
# OMSAD doesn't create pid file
# This directory is needed for OMSA. It should contain libstdc++2
# from Redhat. 
RH_LIBS=${INSTALL_ROOT}/rh-libs

# omawsd
. /etc/sysconfig/omawsd.src
OMAWSD=${INSTALL_ROOT}/iws/bin/linux/omaws${BITS}
# OMAWSD does create pid file, but TODO


DCSTORD=${INSTALL_ROOT}/dataeng/bin/dcstor${BITS}d
DCEVTD=${INSTALL_ROOT}/dataeng/bin/dcevt${BITS}d
DCSNMPD=${INSTALL_ROOT}/dataeng/bin/dcsnmp${BITS}d
#RACSVC=${INSTALL_ROOT}/rac/bin/racsvc

# ...and the pid files
DCSTORD_PIDFILE=/var/run/dcstor${BITS}d.pid
DCEVTD_PIDFILE=/var/run/dcevt${BITS}d.pid
DCSNMPD_PIDFILE=/var/run/dcsnmp${BITS}d.pid
#RACSVC_PIDFILE=/var/run/.dracsvc

#export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${RH_LIBS}:${INSTALL_ROOT}/shared/bin/:${INSTALL_ROOT}/dataeng/bin/

depend() {
	use logger net dellomsa-drivers
}

checkconfig() {
	if [ ! -d ${INSTALL_ROOT} ]; then
		eerror "Directory ${INSTALL_ROOT} does not exist"
		return 1
	fi
	if [ ! -x ${DCSTORD} ]; then
		eerror "File ${DCSTORD} does not exist"
		return 1
	fi
	if [ ! -x ${DCEVTD} ]; then
		eerror "File ${DCEVTD} does not exist"
		return 1
	fi
	if [ ! -x ${INSTALL_ROOT}/omil/prereqcheck/sysreport ]; then
		eerror "File ${INSTALL_ROOT}/omil/prereqcheck/sysreport does not exist"
		return 1
	fi
}

start(){
	checkconfig || return 1
	if ["${DATAENG_ENABLE}" =="yes" ]; then
		
		einfo "Starting Systems Management Data Engine"
		ebegin "Starting dcstor${BITS}d"
		start-stop-daemon --start --quiet --exec ${DCSTORD}  \
			--pidfile ${DCSTORD_PIDFILE} 
		eend $?

		# start dcevt(32|64)d, but only if it's enabled
		if [ "$EVENTD_ENABLED" == "yes" ]; then
			ebegin "Starting dcevt${BITS}d"
			start-stop-daemon --start --quiet --exec ${DCEVTD} \
				--pidfile ${DCEVTD_PIDFILE} 
			eend $?
		fi	

		# start dcsnmp(32|64)d, but only if it's enabled
		if [ "${SNMP_ENABLED}" == "yes" ]; then
			ebegin "Starting dcsnmp${BITS}d"
			start-stop-daemon --start --quiet --exec ${DCSNMPD}  \
				--pidfile ${DCSNMPD_PIDFILE} 
			eend $?
		fi	

		# start omsad(32|64), but only if it's enabled
		if [ "${OMSAD_ENABLED}" == "yes" ]; then
			ebegin "Starting OM Common Services"
			start-stop-daemon --start --quiet --exec ${OMSAD}
			eend $?
		fi	

		# start omawsd, but only if it's enabled
		if [ "${OMAWSD_ENABLED}" == "yes" ]; then
			ebegin "Starting Secure Port Server"
			${OMAWSD} -run
			eend $?
		fi	
			

	fi
}

stop() {
	if ["${DATAENG_ENABLE}" =="yes" ]; then
		einfo "Stopping Systems Management Data Engine"

		if [ "${OMAWSD_ENABLED}" == "yes" ]; then
			ebegin "Stopping Secure Port Server"
			start-stop-daemon --stop --quiet --exec ${OMAWSD}
			eend $?
		fi

		if [ "${OMSAD_ENABLED}" == "yes" ]; then
			ebegin "Stopping OM Common Services"
			start-stop-daemon --stop --quiet --exec ${OMSAD}
			eend $?
		fi

		if [ "${SNMP_ENABLED}" == "yes" ]; then
			ebegin "Stopping dcsnmp${BITS}d"
			start-stop-daemon --stop --quiet --exec ${DCSNMPD}  \
				--pidfile ${DCSNMPD_PIDFILE} 
			eend $?
		fi

		if [ "$EVENTD_ENABLED" == "yes" ]; then
			ebegin "Stopping dcevt${BITS}d"
			start-stop-daemon --stop --quiet --exec ${DCEVTD} \
				--pidfile ${DCEVTD_PIDFILE} 
			eend $?
		fi

		ebegin "Stopping dcstor${BITS}d"
		start-stop-daemon --stop --quiet --exec ${DCSTORD}  \
			--pidfile ${DCSTORD_PIDFILE} 
		eend $?
	fi
}