forked from d2iq-archive/marathon-pkg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmarathon.init
executable file
·56 lines (49 loc) · 1.08 KB
/
marathon.init
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
#!/bin/bash
### BEGIN INIT INFO
# Provides: marathon
# Required-Start: $local_fs $remote_fs $network $syslog
# Required-Stop: $local_fs $remote_fs $network $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Init for Apache Mesos
# Description: Cluster-wide init and control system for Apache Mesos
### END INIT INFO
set -ue
NAME="marathon"
DESC="marathon"
. /lib/lsb/init-functions
PID=/var/run/marathon.pid
start() {
start-stop-daemon --start --background --quiet \
--pidfile "$PID" --make-pidfile \
--exec /usr/bin/marathon
}
stop() {
start-stop-daemon --stop --quiet --pidfile "$PID"
}
case "${1-}" in
start)
echo -n "Starting $DESC: "
start
echo "$NAME."
;;
stop)
echo -n "Stopping $DESC: "
stop
echo "$NAME."
;;
restart)
echo -n "Restarting $DESC: "
stop
sleep 1
start
echo "$NAME."
;;
status)
status_of_proc -p "$PID" "$NAME" "$NAME"
;;
*)
echo "Usage: $0 {start|stop|restart|status}" >&2
exit 1
;;
esac