aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fifo-cronolog.confd3
-rw-r--r--fifo-cronolog.initd12
2 files changed, 15 insertions, 0 deletions
diff --git a/fifo-cronolog.confd b/fifo-cronolog.confd
index 9eec589..a73e291 100644
--- a/fifo-cronolog.confd
+++ b/fifo-cronolog.confd
@@ -1,6 +1,9 @@
# 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
diff --git a/fifo-cronolog.initd b/fifo-cronolog.initd
index e04b272..b5a637e 100644
--- a/fifo-cronolog.initd
+++ b/fifo-cronolog.initd
@@ -5,6 +5,18 @@
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 $?