-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathmesos-master
65 lines (54 loc) · 1.05 KB
/
mesos-master
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
#!/bin/bash
#
# /etc/init.d/mesos-master
#
# Startup script for mesos-master
#
# chkconfig: 2345 20 80
# description: Starts and stops mesos-master
. /etc/init.d/functions
prog="mesos-master"
mesosBin="/usr/sbin/$prog"
desc="Mesos Master daemon"
outFile="/var/log/mesos/$prog.out"
if ! [ -f $mesosBin ]; then
echo "$prog binary not found."
exit 5
fi
if [ -f /etc/sysconfig/mesos ]; then
. /etc/sysconfig/mesos
fi
start() {
echo "Starting $desc ($prog): "
su $mesosUser -c "nohup $mesosBin --quiet --conf=/etc/mesos/conf/ >>$outFile 2>&1 &"
RETVAL=$?
return $RETVAL
}
stop() {
echo "Shutting down $desc ($prog): "
pkill -f $mesosBin
}
restart() {
stop
start
}
status() {
if [ -z $pid ]; then
pid=$(pgrep -f $mesosBin)
fi
if [ -z $pid ]; then
echo "$prog is NOT running."
return 1
else
echo "$prog is running (pid is $pid)."
fi
}
case "$1" in
start) start;;
stop) stop;;
restart) restart;;
status) status;;
*) echo "Usage: $0 {start|stop|restart|status}"
RETVAL=2;;
esac
exit $RETVAL