Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEAT] Not possible to get debug output running as an S6 service #53

Open
1 task done
rpatterson opened this issue Jan 5, 2025 · 1 comment
Open
1 task done

Comments

@rpatterson
Copy link

Is this a new feature request?

  • I have searched the existing issues

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.

Copy link

github-actions bot commented Jan 5, 2025

Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Issues
Development

No branches or pull requests

1 participant