Repository navigation
Module side of the systemd mode: READY=1, no duplicate journal lines, pyobsd exec - #1106
Merged
Merged
Conversation
… pyobsd exec - Application sends READY=1 once the module is open (no-op without $NOTIFY_SOCKET). - With --syslog, no stderr handler if stderr is the journal ($JOURNAL_STREAM compared with stderr's device and inode, since children inherit it). - pyobsd exec <module> (hidden): finds <module>.yaml or _<module>.yaml and execs pyobs in the foreground with the options from the pyobsd config, without --pid-file. Argument building is shared with the PID-file mode. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Second step of the pyobsd systemd mode (
specs/plans/2026-11-25-pyobsd-systemd-mode.md). Everything here is a no-op outside systemd, so it can be released before the systemd backend lands.Changes
READY=1:Application._main()sendsREADY=1right afterstartup(), beforemain().shutdown.notifydoes nothing without$NOTIFY_SOCKET. Ifstartup()fails, nothing is sent.--syslog, no stderrStreamHandlerwhen stderr is the journal._stderr_is_journal()compares$JOURNAL_STREAMwith stderr's device and inode (systemd.exec(5)), because child processes inherit the variable even when their stderr goes elsewhere. Output written straight to stderr (tracebacks, C libraries) still reaches the journal.pyobsd exec <module>: internal and hidden from--help. It looks up<module>.yaml, then_<module>.yaml, andexecspyobsin the foreground with the options from the pyobsd config, without--pid-file. It works in both modes and doesn't usechuid. The argument building (_pyobs_args) is shared with the PID-file backend, and the arguments that backend passes are unchanged.Tests
tests/test_application_systemd.pyandtests/cli/test_pyobsd_exec.py.Open for the next PR
Applicationexits with code 0 even after a caught exception instartup()/main(), so withRestart=on-failurea crashed module would not be restarted. That gets decided together with the unit.🤖 Generated with Claude Code