Browse Source

Merge pull request #31314 from williamh/split-openrc-log

contrib/init/openrc: allow separate logs for stdout and stderr
Sebastiaan van Stijn 8 years ago
parent
commit
8b6ae13c08
2 changed files with 13 additions and 1 deletions
  1. 10 0
      contrib/init/openrc/docker.confd
  2. 3 1
      contrib/init/openrc/docker.initd

+ 10 - 0
contrib/init/openrc/docker.confd

@@ -1,8 +1,18 @@
 # /etc/conf.d/docker: config file for /etc/init.d/docker
 # /etc/conf.d/docker: config file for /etc/init.d/docker
 
 
 # where the docker daemon output gets piped
 # where the docker daemon output gets piped
+# this contains both stdout and stderr. If  you need to separate them,
+# see the settings below
 #DOCKER_LOGFILE="/var/log/docker.log"
 #DOCKER_LOGFILE="/var/log/docker.log"
 
 
+# where the docker daemon stdout gets piped
+# if this is not set, DOCKER_LOGFILE is used
+#DOCKER_OUTFILE="/var/log/docker-out.log"
+
+# where the docker daemon stderr gets piped
+# if this is not set, DOCKER_LOGFILE is used
+#DOCKER_ERRFILE="/var/log/docker-err.log"
+
 # where docker's pid get stored
 # where docker's pid get stored
 #DOCKER_PIDFILE="/run/docker.pid"
 #DOCKER_PIDFILE="/run/docker.pid"
 
 

+ 3 - 1
contrib/init/openrc/docker.initd

@@ -6,8 +6,10 @@ command="${DOCKERD_BINARY:-/usr/bin/dockerd}"
 pidfile="${DOCKER_PIDFILE:-/run/${RC_SVCNAME}.pid}"
 pidfile="${DOCKER_PIDFILE:-/run/${RC_SVCNAME}.pid}"
 command_args="-p \"${pidfile}\" ${DOCKER_OPTS}"
 command_args="-p \"${pidfile}\" ${DOCKER_OPTS}"
 DOCKER_LOGFILE="${DOCKER_LOGFILE:-/var/log/${RC_SVCNAME}.log}"
 DOCKER_LOGFILE="${DOCKER_LOGFILE:-/var/log/${RC_SVCNAME}.log}"
+DOCKER_ERRFILE="${DOCKER_ERRFILE:-${DOCKER_LOGFILE}}"
+DOCKER_OUTFILE="${DOCKER_OUTFILE:-${DOCKER_LOGFILE}}"
 start_stop_daemon_args="--background \
 start_stop_daemon_args="--background \
-	--stderr \"${DOCKER_LOGFILE}\" --stdout \"${DOCKER_LOGFILE}\""
+	--stderr \"${DOCKER_ERRFILE}\" --stdout \"${DOCKER_OUTFILE}\""
 
 
 start_pre() {
 start_pre() {
 	checkpath -f -m 0644 -o root:docker "$DOCKER_LOGFILE"
 	checkpath -f -m 0644 -o root:docker "$DOCKER_LOGFILE"