Skip to content

Commit d1bf426

Browse files
committed
openrc-run: default supervisor stdout and stderr to logger
Currently we redirect any stdout and stderr output to /dev/null. This is making debugging, or helping others debug, unnecessarily harder, so let's just assign a sane default that should work on most systems.
1 parent ef19341 commit d1bf426

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

etc/rc.conf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,13 @@
5454
# The default value is: /var/log/rc.log
5555
#rc_log_path="/var/log/rc.log"
5656

57+
# rc_output_logger and rc_error_logger specify the default commands
58+
# used to log the stdout and stderr of services.
59+
# Scripts can override those by setting output_logger and error_logger,
60+
# respectively, to a value, or disable logging by setting to null.
61+
#rc_output_logger="logger -t 'openrc[$RC_SVCNAME]' -p daemon.notice"
62+
#rc_error_logger="logger -t 'openrc[$RC_SVCNAME]' -p daemon.err"
63+
5764
# If you want verbose output for OpenRC, set this to yes. If you want
5865
# verbose output for service foo only, set it to yes in /etc/conf.d/foo.
5966
#rc_verbose=no

sh/openrc-run.sh.in

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,10 @@ _status()
164164
default_start()
165165
{
166166
local func=ssd_start
167+
168+
: ${output_logger=${rc_output_logger-"logger -t 'openrc[$RC_SVCNAME]' -p daemon.notice"}}
169+
: ${error_logger=${rc_error_logger-"logger -t 'openrc[$RC_SVCNAME]' -p daemon.err"}}
170+
167171
case "$supervisor" in
168172
runit) func=runit_start ;;
169173
s6) func=s6_start ;;

0 commit comments

Comments
 (0)