diff options
author | Robin H. Johnson <robbat2@gentoo.org> | 2024-03-12 06:07:07 -0700 |
---|---|---|
committer | Robin H. Johnson <robbat2@gentoo.org> | 2024-03-12 06:08:54 -0700 |
commit | dd64f64db665840b35cd980291f1c14711ac42d2 (patch) | |
tree | 1498a05fa0e9acd659dba3136d0b093686fdbfeb /openrc | |
parent | Revision bump. (diff) | |
download | fifo-cronolog-dd64f64db665840b35cd980291f1c14711ac42d2.tar.gz fifo-cronolog-dd64f64db665840b35cd980291f1c14711ac42d2.tar.bz2 fifo-cronolog-dd64f64db665840b35cd980291f1c14711ac42d2.zip |
feat: systemd supportv1.2.0
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
Diffstat (limited to 'openrc')
-rw-r--r-- | openrc/fifo-cronolog.confd | 11 | ||||
-rw-r--r-- | openrc/fifo-cronolog.initd | 29 |
2 files changed, 40 insertions, 0 deletions
diff --git a/openrc/fifo-cronolog.confd b/openrc/fifo-cronolog.confd new file mode 100644 index 0000000..a73e291 --- /dev/null +++ b/openrc/fifo-cronolog.confd @@ -0,0 +1,11 @@ +# Various paths: +PIDFILE="/var/run/fifo-cronolog.pid" +FIFO="/var/lib/fifo-cronolog.fifo" +# User/Group of the fifo owner, will be set during startup if the fifo doesn't exist already +FIFO_OWNER="root:root" +FIFO_PERMS="0600" +LOGS="/var/log/fifo-cronolog/transfer/%Y%m%d.log" + +# Uncomment and add the service name you want to use it for to ensure +# fifo-cronolog start first. +#rc_fifo_cronolog_before="squid varnish" diff --git a/openrc/fifo-cronolog.initd b/openrc/fifo-cronolog.initd new file mode 100644 index 0000000..30812e6 --- /dev/null +++ b/openrc/fifo-cronolog.initd @@ -0,0 +1,29 @@ +#!/sbin/runscript +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +start() { + ebegin "Starting fifo-cronolog" + + if [ ! -e "${FIFO}" ]; then + mkfifo $FIFO || eend $? + fi + if [ -p "${FIFO}" ]; then + chown $FIFO_OWNER $FIFO || eend $? + chmod $FIFO_PERMS $FIFO || eend $? + else + eerror "${FIFO} is not a valid FIFO!" + eend 1 + fi + + start-stop-daemon --start --exec /usr/sbin/fifo-cronolog \ + --pidfile "${PIDFILE}" -- "${PIDFILE}" "${FIFO}" "${LOGS}" + eend $? +} + +stop() { + ebegin "Stopping fifo-cronolog" + start-stop-daemon --stop --exec /usr/sbin/fifo-cronolog \ + --pidfile "${PIDFILE}" + eend $? +} |