aboutsummaryrefslogtreecommitdiffstats
path: root/main/collectd/collectd.initd
diff options
context:
space:
mode:
Diffstat (limited to 'main/collectd/collectd.initd')
-rw-r--r--main/collectd/collectd.initd27
1 files changed, 12 insertions, 15 deletions
diff --git a/main/collectd/collectd.initd b/main/collectd/collectd.initd
index 9cacf2e066..4ff1e6442c 100644
--- a/main/collectd/collectd.initd
+++ b/main/collectd/collectd.initd
@@ -1,20 +1,17 @@
#!/sbin/openrc-run
-DAEMON=/usr/sbin/collectd
+COLLECTD_USER=${COLLECTD_USER:-"collectd"}
+COLLECTD_GROUP=${COLLECTD_GROUP:-"collectd"}
+COLLECTD_ARGS=${COLLECTD_ARGS:-""}
+COLLECTD_PIDFILE=${COLLECTD_PIDFILE:-"/run/collectd/collectd.pid"}
-depend() {
- need net
-}
-
-start() {
- ebegin "Starting collectd"
- start-stop-daemon --start --exec $DAEMON -- $collectd_options
- eend $?
-}
+command=/usr/sbin/collectd
+pidfile="$COLLECTD_PIDFILE"
+command_args="${COLLECTD_ARGS} -P $pidfile"
+start_stop_daemon_args="--user ${COLLECTD_USER}:${COLLECTD_GROUP}"
+retry=${COLLECTD_TERMTIMEOUT:-"TERM/25/KILL/5"}
-stop () {
- ebegin "Stopping collectd"
- start-stop-daemon --stop --exec $DAEMON
- eend $?
+start_pre() {
+ checkpath --directory --owner "$COLLECTD_USER":"$COLLECTD_GROUP" \
+ --mode 0770 "$(dirname $pidfile)" /var/lib/collectd
}
-