aboutsummaryrefslogtreecommitdiffstats
path: root/main/collectd/collectd.initd
diff options
context:
space:
mode:
authorCarlo Landmeter <clandmeter@gmail.com>2016-11-14 17:46:46 +0100
committerCarlo Landmeter <clandmeter@gmail.com>2016-11-14 17:48:48 +0100
commit5449e11d98d303ae5669b3f686aa4ff546b1d1dd (patch)
tree38ce7eba4ab58e23a79291d00656a276ab96a79e /main/collectd/collectd.initd
parentdeab96c6016be38ab793c6ad0c4f8227d0984235 (diff)
downloadaports-5449e11d98d303ae5669b3f686aa4ff546b1d1dd.tar.bz2
aports-5449e11d98d303ae5669b3f686aa4ff546b1d1dd.tar.xz
main/collectd: various changes/fixes
run as collectd user (do not run as root) split libs utils and disk (add eudev support) add plugins lvm lua mqtt
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
}
-