summaryrefslogtreecommitdiff
path: root/system/netdata/rc.netdata
diff options
context:
space:
mode:
authorWilly Sudiarto Raharjo <willysr@slackbuilds.org>2017-01-24 19:41:08 +0000
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2017-01-28 07:37:59 +0700
commit7bc511d82ad6cb8faf15099b23081b0fd54f58d9 (patch)
tree097b939be461ef13afc57086349b4bd1c951decb /system/netdata/rc.netdata
parent5ce6a3383c6d908c39086321f6fc14f830dd300d (diff)
downloadslackbuilds-7bc511d82ad6cb8faf15099b23081b0fd54f58d9.tar.gz
system/netdata: Added (real-time monitoring system).
Signed-off-by: David Spencer <idlemoor@slackbuilds.org>
Diffstat (limited to 'system/netdata/rc.netdata')
-rw-r--r--system/netdata/rc.netdata45
1 files changed, 45 insertions, 0 deletions
diff --git a/system/netdata/rc.netdata b/system/netdata/rc.netdata
new file mode 100644
index 0000000000..7e98a703db
--- /dev/null
+++ b/system/netdata/rc.netdata
@@ -0,0 +1,45 @@
+#!/bin/sh
+
+DAEMON="netdata"
+DAEMON_PATH=/usr/sbin
+PIDFILE=/var/run/$DAEMON.pid
+DAEMONOPTS="-P $PIDFILE"
+LOCKFILE=/var/lock/subsys/$DAEMON
+
+service_start()
+{
+ [ -x $DAEMON_PATH ] || exit 5
+ echo "Starting $DAEMON..."
+ if [ -e "$LOCKFILE" ]; then
+ echo "netdata server already running!"
+ echo "Please remove $LOCKFILE"
+ else
+ $DAEMON_PATH/$DAEMON $DAEMONOPTS &
+ touch $LOCKFILE
+ fi
+}
+
+service_stop()
+{
+ echo "Stopping $DAEMON..."
+ killall $DAEMON > /dev/null 2>&1
+ rm -f $LOCKFILE
+}
+
+
+case "$1" in
+start)
+ service_start
+;;
+stop)
+ service_stop
+;;
+restart)
+ service_stop
+ sleep 2
+ service_start
+;;
+*)
+ echo "Usage: $0 {start|stop|restart}"
+ exit 1
+esac