blob: b9b5f5ad2ded5fb29a4b2a79ffbb7ead4fc6f593 (
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
|
#!/bin/bash
#
# netconsole This loads the netconsole module with the configured parameters.
#
# chkconfig:123456 40 60
# description: keepsupalive
source /etc/profile
PRO_NAME=keepsupalive
case $1 in
start)
keepnum=`ps -ef | grep dae-supervisor.sh | grep -v grep | wc -l`
if [ $keepnum -eq "0" ];then
nohup {{ install_path }}/{{ storm_version }}/bin/dae-supervisor.sh > /dev/null 2>&1 &
fi
;;
stop)
keeppid=`ps -ef | grep dae-supervisor.sh | grep -v grep | awk '{print $2}'`
echo "守护进程PID:$keeppid"
kill -9 $keeppid
sleep 1
nimpid=`jps | grep supervisor | grep -v grep | awk '{print $1}'`
echo "supervisor PID:$nimpid"
kill -9 $nimpid
;;
status)
num=`jps | grep -w supervisor | grep -v grep |wc -l`
if [ "$num" -eq "1" ];then
echo "storm-supervisor 进程已启动"
else
echo "storm-supervisor 进程未启动"
fi
;;
* )
echo "use keepsupalive [start|stop|status]"
;;
esac
|