plugins icon indicating copy to clipboard operation
plugins copied to clipboard

dns/rfc2136 doesn't log errors in nsupdate invocation

Open maederm opened this issue 10 months ago • 0 comments

Important notices Before you add a new report, we ask you kindly to acknowledge the following:

  • [X] I have read the contributing guide lines at https://github.com/opnsense/plugins/blob/master/CONTRIBUTING.md
  • [X] I have searched the existing issues, open and closed, and I'm convinced that mine is new.
  • [X] The title contains the plugin to which this issue belongs

Describe the bug If the nsupdate invocation fails like in the issue addressed in https://github.com/opnsense/plugins/pull/3895 the error isn't shown to the user in the UI.

To Reproduce Steps to reproduce the behavior: (Having a working IPv6 configuration on WAN interface having a link-local and a global IPv6 address)

  1. Go to Services, RFC 2136 and configure an entry using IPv6 on WAN interface
  2. Click on Save and Force Update
  3. See that no error is logged in System / Log Files / General
  4. Run /usr/local/bin/nsupdate -k /var/etc/nsupdatekey0 /var/etc/nsupdatecmds0 manually and see an error

Expected behavior Invocations that result in a non-zero exit code of nsupdate should show up in System / Log Files / General.

Relevant log files None, unfortunately.

Additional context The plugin uses mwexec_bg which doesn't alert nor log if a non-zero exit code happened. This is because mwexec_bg calls /usr/sbin/daemon which detaches from the current shell and therefore can't give back the error result.

I could write a PR but I don't know what the preferred way of doing error handling for background processes in this project is.

Environment OPNsense 24.1.5_3-amd64

maederm avatar Apr 07 '24 13:04 maederm