diff options
author | Alexey Vekshin <some_hren@yahoo.com> | 2018-11-30 12:02:16 +0300 |
---|---|---|
committer | Paweł Krupa <pawel@krupa.net.pl> | 2018-11-30 11:02:16 +0200 |
commit | 7cbb47be0c26b5bd91e95ac010129668e4b49eb0 (patch) | |
tree | 99dd200da3f863b53278c5206d4696f941948b79 /contrib/sles11/netdata.init | |
parent | 0cb72d21e879c96a02bcd450c5b61e9cc3a611d9 (diff) |
RPM spec and patches for sles 11 (#3708)
* RPM spec and patches for sles 11
* some fixes to alarm-notify.bash3 to make codacity happy
* replace ugly bash3 alarm notifier with trimmed rewrite
* notification format fixes
* update README for sles11 contrib
Diffstat (limited to 'contrib/sles11/netdata.init')
-rwxr-xr-x | contrib/sles11/netdata.init | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/contrib/sles11/netdata.init b/contrib/sles11/netdata.init new file mode 100755 index 0000000000..3081c427c8 --- /dev/null +++ b/contrib/sles11/netdata.init @@ -0,0 +1,65 @@ +#!/bin/bash +# +### BEGIN INIT INFO +# Provides: netdata +# Required-Start: $all +# Should-Start: +# Required-Stop: $all +# Should-Stop: +# Default-Start: 2 3 5 +# Default-Stop: +# Short-Description: Start and stop the netdata real-time monitoring server daemon +# Description: Controls the main netdata monitoring server daemon "netdata". +### END INIT INFO + +DAEMON="netdata" +DAEMON_BIN="/usr/sbin/${DAEMON}" +DAEMON_PID="/var/run/${DAEMON}.pid" +DAEMON_ARGS="" + +. /etc/rc.status +rc_reset + +if [ ! -x $DAEMON_BIN ]; then + echo -n >&2 "${DAEMON} binary is not installed. " + rc_status -s + exit 5 +fi + +case "$1" in + start) + echo -n "Starting $DAEMON" + /sbin/startproc $DAEMON_BIN $DAEMON_ARGS + rc_status -v + ;; + + stop) + echo -n "Stopping $DAEMON" + /sbin/killproc $DAEMON_BIN + rc_status -v + ;; + + reload) + # netdata: HUP reopen log files, USR1 save DB, USR2 reload health config + echo -n "Reloading $DAEMON config" + /sbin/killproc -USR2 $DAEMON_BIN + ;; + + restart) + $0 stop + $0 start + ;; + + status) + echo -n "Checking $DAEMON" + /sbin/checkproc $DAEMON_BIN + rc_status -v + ;; + + *) + echo "Usage: $0 {start|stop|status|reload|restart}" + exit 1 + ;; + +esac +rc_exit |