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

Bug or feature?: daemon off mode handling by zdctl start #34

Open
d-maurer opened this issue Mar 15, 2024 · 0 comments
Open

Bug or feature?: daemon off mode handling by zdctl start #34

d-maurer opened this issue Mar 15, 2024 · 0 comments
Labels

Comments

@d-maurer
Copy link
Contributor

During my analysis of #32 I hit a behavior of zdctl start for daemon off mode which I consider a bug but which might be a feature:
In daemon off mode, zdctl start starts a zdrun process (which in turn starts the "program process") but waits for the zdrun process to terminate. This will only happen when the "program process" terminates (more or less regularly) or the zdrun process gets terminated by a signal.
This makes zdctl start behave very much like zdctl fg; the difference: the intermediate zdrun process may restart the "program process" should this terminate irregularly.
In daemon on mode, zdctl start returns immediately after the zdrun process is started; the zdrun and "program" processes can then be controlled via subsequent zdctl commands.

I expected the zdctl start behavior independent of "daemon" mode, because "daemon mode" essentially controls whether the effective zdrun process should be a true daemon (with its own process group, detached from the control terminal, input and output streams redirected to /dev/null, ...).

I found, however, that zdctl start in daemon off mode is more like zdctl fg than zdctl start (in `daemon on' mode).

I was interested in daemon off mode to be able to debug the zdrun process. In demon on mode, the zdrun process has its input and output streams (used by the debugger) redirected to /dev/null, making debugging extremely difficult. I found that the "transcript" feature (controlled via the -t option) allows at least the use of debugging output.

I have a patch to make the zdctl start behavior independent of the "daemon" mode. However, this would break cases depending on the current behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant