summaryrefslogtreecommitdiff
blob: c7cdd224dcd8495c7ffc62d17663a811ecf26fa8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
From 65c1a3be5bf748f95edc45f1391c869bf4ff4a52 Mon Sep 17 00:00:00 2001
From: William Hubbs <w.d.hubbs@gmail.com>
Date: Thu, 23 Feb 2017 17:07:26 -0600
Subject: [PATCH] contrib/init/openrc: allow separate logs for stdout and
 stderr

Signed-off-by: William Hubbs <w.d.hubbs@gmail.com>
---
 contrib/init/openrc/docker.confd | 10 ++++++++++
 contrib/init/openrc/docker.initd |  4 +++-
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/contrib/init/openrc/docker.confd b/contrib/init/openrc/docker.confd
index 2444031..89183de 100644
--- a/contrib/init/openrc/docker.confd
+++ b/contrib/init/openrc/docker.confd
@@ -1,8 +1,18 @@
 # /etc/conf.d/docker: config file for /etc/init.d/docker
 
 # 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"
 
+# 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
 #DOCKER_PIDFILE="/run/docker.pid"
 
diff --git a/contrib/init/openrc/docker.initd b/contrib/init/openrc/docker.initd
index 5d31603..6c968f6 100644
--- a/contrib/init/openrc/docker.initd
+++ b/contrib/init/openrc/docker.initd
@@ -6,8 +6,10 @@ command="${DOCKERD_BINARY:-/usr/bin/dockerd}"
 pidfile="${DOCKER_PIDFILE:-/run/${RC_SVCNAME}.pid}"
 command_args="-p \"${pidfile}\" ${DOCKER_OPTS}"
 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 \
-	--stderr \"${DOCKER_LOGFILE}\" --stdout \"${DOCKER_LOGFILE}\""
+	--stderr \"${DOCKER_ERRFILE}\" --stdout \"${DOCKER_OUTFILE}\""
 
 start_pre() {
 	checkpath -f -m 0644 -o root:docker "$DOCKER_LOGFILE"
-- 
2.10.2