Created
January 29, 2018 06:18
-
-
Save inklit/1cfefc40e802d18851339bb50f67a5a6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/sbin/openrc-run | |
description="node_exporter" | |
: ${NODE_PIDFILE:=/var/run/node_exporter.pid} | |
: ${NODE_USER:=root} | |
depend() { | |
need net | |
need localmount | |
use dns | |
after firewall | |
} | |
start() { | |
ebegin "Starting node_exporter" | |
start-stop-daemon --wait 1000 --background --start --exec \ | |
/usr/sbin/node_exporter \ | |
--user ${NODE_USER} \ | |
--make-pidfile --pidfile ${NODE_PIDFILE} \ | |
-- && \ | |
chown ${NODE_USER}:root ${NODE_PIDFILE} | |
eend $? | |
} | |
stop() { | |
ebegin "Stopping node_exporter" | |
start-stop-daemon --wait 5000 --stop --exec \ | |
/usr/sbin/node_exporter \ | |
--user ${NODE_USER} \ | |
--pidfile ${NODE_PIDFILE} \ | |
-s SIGQUIT | |
eend $? | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment