-
Notifications
You must be signed in to change notification settings - Fork 49
/
Copy pathzbxtable.init
63 lines (56 loc) · 1.09 KB
/
zbxtable.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
56
57
58
59
60
61
62
63
#!/bin/env bash
# chkconfig: - 86 14
# description: zbxtable daemon
#
### BEGIN INIT INFO
# Provides: zbxtable
# Required-Start: $local_fs $network
# Required-Stop: $local_fs $network
# Default-Start:
# Default-Stop: 0 1 2 3 4 5 6
# Short-Description: Start and stop zbxtable
# Description: zbxtable
### END INIT INFO
# Source function library.
. /etc/init.d/functions
# ENV
ZBXTABLE_HOME="/usr/local/zbxtable"
APP_NAME="zbxtable"
timeout=10
lockfile=/var/lock/subsys/zbxtable
start()
{
echo -n $"Starting ZbxTable: "
cd $ZBXTABLE_HOME
nohup $ZBXTABLE_HOME/$APP_NAME web >> $ZBXTABLE_HOME/logs/$APP_NAME.log 2>&1 & echo $! >/tmp/$APP_NAME.pid &
rv=$?
echo
[ $rv -eq 0 ] && touch $lockfile
return $rv
}
stop()
{
echo -n $"Shutting down ZbxTable: "
killproc -p /tmp/$APP_NAME.pid -d $timeout
rv=$?
echo
[ $rv -eq 0 ] && rm -f $lockfile
return $rv
}
restart()
{
stop
start
}
case "$1" in
start|stop|restart)
$1
;;
force-reload)
restart
;;
*)
echo $"Usage: $0 {start|stop|restart|force-reload}"
exit 2
;;
esac