From e1b40351e6de60fa39f0b7d4e6268ddceeffe92f Mon Sep 17 00:00:00 2001 From: Christian Ruppert Date: Mon, 11 Oct 2010 22:39:01 +0200 Subject: Create the fifo inside of the init script. --- fifo-cronolog.confd | 3 +++ fifo-cronolog.initd | 12 ++++++++++++ 2 files changed, 15 insertions(+) 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 $? -- cgit v1.2.3-65-gdbad