Is this a new feature request?
Wanted change
It should be possible to apply any control over output that the main service provides without deep internal knowledge.
Reason for change
ZNC provides a --debug CLI option for inspecting the full set of commands between ZNC, clients and servers but the S6 service hard-codes the CLI options so working around this requires understanding S6. It also provides a admindebug module, but that module requires a TTY and so won't work alongside everything else S6-overlay provides. The --debug option is more "low-level" and just more important to support.
Proposed code change
To workaround this, I exported the /etc/s6-overlay/s6-rc.d/svc-znc/run file from the container and applied the following change to add the --debug CLI option when the DEBUG environment variable was set:
modified znc/etc/s6-overlay/s6-rc.d/svc-znc/run
@@ -3,7 +3,14 @@
PORT=$(grep "Port =" /config/configs/znc.conf | awk -F '=' '{print $2;exit}')
+ZNC_ARGS=""
+if [ "${DEBUG:=}" = "true" ]
+then
+ # Echo IRC commands for easier debugging:
+ ZNC_ARGS+="--debug"
+fi
+
exec \
s6-notifyoncheck -d -n 300 -w 1000 -c "nc -z localhost ${PORT}" \
s6-setuidgid abc /usr/local/bin/znc -d /config \
- --foreground
+ --foreground ${ZNC_ARGS}
But if I were tackling this issue, I would prefer adding some generalized support for including additional CLI arguments for the container's "main" service to S6-overlay and use that, even if that's little more than a convention.
Is this a new feature request?
Wanted change
It should be possible to apply any control over output that the main service provides without deep internal knowledge.
Reason for change
ZNC provides a
--debugCLI option for inspecting the full set of commands between ZNC, clients and servers but the S6 service hard-codes the CLI options so working around this requires understanding S6. It also provides aadmindebugmodule, but that module requires a TTY and so won't work alongside everything else S6-overlay provides. The--debugoption is more "low-level" and just more important to support.Proposed code change
To workaround this, I exported the
/etc/s6-overlay/s6-rc.d/svc-znc/runfile from the container and applied the following change to add the--debugCLI option when theDEBUGenvironment variable was set:But if I were tackling this issue, I would prefer adding some generalized support for including additional CLI arguments for the container's "main" service to S6-overlay and use that, even if that's little more than a convention.