Repository navigation
pyobsd: mode switch, PID-file backend, guard against --pid-file in systemd mode - #1105
Merged
Merged
Conversation
…file - pyobsd.mode in the config file, --mode and $PYOBSD_MODE (pid or systemd, default pid), with one lookup (pyobsd_mode) shared by pyobs and pyobsd. systemd mode exits with "not implemented yet" for now. - The PID-file code moves unchanged into PidFileDaemon, shared parts into PyobsDaemonBase. PyobsDaemon stays as an alias. - pyobs refuses --pid-file in systemd mode unless PYOBSD_MODE=pid, which pyobsd in PID-file mode sets for the modules it starts. 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.
First step of the pyobsd systemd mode (
specs/plans/2026-11-25-pyobsd-systemd-mode.md). There's no systemd backend yet.Changes
pyobsd.modein the config file,--modeand$PYOBSD_MODE(pidorsystemd, defaultpid).pyobsd_mode()inpyobs/cli/_cli.pydoes the lookup for both CLIs: the environment first, then the config file.CLI.file_confignow holds the whole config file, sopyobscan read thepyobsdsection. In systemd mode, pyobsd exits with "not implemented yet".PidFileDaemon. The parts both modes share (names, configs, process info,list,logs) go into the abstractPyobsDaemonBase.PyobsDaemonstays as an alias, so the existing tests run unchanged.pyobs --pid-filerefuses to start when the config sayssystemd, unlessPYOBSD_MODE=pidis set. pyobsd in PID-file mode now always passesPYOBSD_MODE=pidto the modules it starts, sopyobsd --mode pidalso works on a systemd host. This is the one behavior change in the PID-file backend:Popennow always gets anenv.Tests
tests/cli/test_mode.py: the lookup,file_config, the guard,--mode, and the env passed to the modules.tests/cli/test_pyobsd_pidmode.pyandtest_pyobsd.pypass unchanged.🤖 Generated with Claude Code