-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathseyren
85 lines (67 loc) · 1.69 KB
/
seyren
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
#!/bin/bash
# seyren - Startup script for seyren
# chkconfig: 35 85 15
# description: Seyren - Graphite Alerting Tool
# processname: seyren
# config /usr/local/seyren-master
# pidfile: /usr/local/seyren-master/seyren.pid
. /etc/rc.d/init.d/functions
## Environment Variables -- Fill in your Environment Variables GRAPHITE_URL/SMTPHOST/SMTPPORT
hostname=`hostname`
GRAPHITE_URL=""
export GRAPHITE_URL
SMTP_HOST=""
export SMTP_HOST
SMTP_PORT=""
export SMTP_PORT
SEYREN_URL="http://$hostname:8080/seyren"
export SEYREN_URL
PIDGET=$(ps -ef | grep seyren | grep -v grep | awk '{print $2}')
# Seyren Daemon - Enter your Java location and seyren-master install directories - Amend the log directory if needed
seyrend=${SEYREND- ADDJAVADIRHERE -jar ADDSEYRENMASTERHERE/seyren-web/target/dependency/jetty-runner.jar --path /seyren ADDSEYRENMASTERHERE/seyren-web/target/*.war > /dev/null 2>&1 >> /var/log/seyren/seyren.output.log 2>> /var/log/seyren/seyren.log &}
SEYREN_USER=seyren
SEYREN_GROUP=seyren
start()
{
echo -n $"Starting seyren: "
daemon --user "$SEYREN_USER" $seyrend
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/seyrend
}
stop()
{
echo -n $"Stopping seyren: "
/bin/kill -9 $PIDGET
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/seyrend
}
restart () {
stop
start
}
ulimit -n 12000
RETVAL=0
case "$1" in
start)
start
;;
stop)
stop
;;
restart|reload|force-reload)
restart
;;
condrestart)
[ -f /var/lock/subsys/seyrend ] && restart || :
;;
status)
status $seyrend
RETVAL=$?
;;
*)
echo "Usage: $0 {start|stop|status|restart|reload|force-reload|condrestart}"
RETVAL=1
esac
exit $RETVAL