diff options
author | Carlo Landmeter <clandmeter@gmail.com> | 2011-11-03 15:02:42 +0000 |
---|---|---|
committer | Carlo Landmeter <clandmeter@gmail.com> | 2011-11-03 15:02:42 +0000 |
commit | efd20b4ba26de55485f2e8c15b1d61ce8501ecc2 (patch) | |
tree | 22296b0d71d6eb39ba506848e946931dcc0afe23 /testing/cluster-glue/ha_logd.initd | |
parent | b758cfb575b2f9d7158040a9d72ec00086da0e7d (diff) | |
download | aports-efd20b4ba26de55485f2e8c15b1d61ce8501ecc2.tar.bz2 aports-efd20b4ba26de55485f2e8c15b1d61ce8501ecc2.tar.xz |
testing/cluster-glue: new aport
Diffstat (limited to 'testing/cluster-glue/ha_logd.initd')
-rw-r--r-- | testing/cluster-glue/ha_logd.initd | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/testing/cluster-glue/ha_logd.initd b/testing/cluster-glue/ha_logd.initd new file mode 100644 index 0000000000..3d318e7ae5 --- /dev/null +++ b/testing/cluster-glue/ha_logd.initd @@ -0,0 +1,46 @@ +#!/sbin/runscript + +PIDFILE=/var/run/heartbeat-logd.pid + +depend() { + need net +} + +BINARY="/usr/%libdir%/heartbeat/ha_logd" +USER="hacluster" +GROUP="haclient" +CONFIG="/etc/logd.cf" +LOGFILE="/var/log/ha_logger.log" + +start() { + ebegin "Starting heartbeat non-blocking log service" + + COMMAND_ARGS="-d" + [[ -f "${CONFIG}" ]] && COMMAND_ARGS+=" -c ${CONFIG}" + + if [ -n "${RC_UNAME}" ]; then + PARAMS="--background --stdout '${LOGFILE}' --stderr '${LOGFILE}' -- ${ARGS}" + else + PARAMS="-- ${ARGS} >> '${LOGFILE}' 2>&1 &" + fi + eval ${CHRT} start-stop-daemon \ + --quiet --start --chdir "${RUNTIMEDIR}" \ + --pidfile "${PIDFILE}" \ + --make-pidfile \ + --exec ${BINARY} ${COMMAND_ARGS} --chuid "${USER}:${GROUP}" \ + ${PARAMS} + eend $? +} + +stop() { + ebegin "Stopping heartbeat non-blocking log service" + start-stop-daemon --stop --retry 3 --quiet --exec "${BINARY}" + rm -f "${PIDFILE}" + eend $? +} + +restart() { + stop + sleep 3 + start +} |