fix refresh when service_manage = false - #129
Open
ThomasLohner wants to merge 15 commits into
Open
Conversation
…ip installations (skip install, if file exists to skip install in default pyenv)
…ndant pip installs in new virtual environments
… zpinit When the global hiera key sc::service_manager is 'zpinit': - supervisord::program emits a zpinit::service instead of supervisord config + supervisorctl, while STILL declaring Supervisord::Program[$title] so existing before/require/notify => Supervisord::Program[X] references keep resolving on both backends (no data rewrite needed); - supervisord::install is a no-op (daemon not installed); - supervisord::service is a no-op (daemon service not managed). The supervisord class stays loadable as a harmless no-op, so nodes do not need to exclude it. Transitional shim while the fleet migrates to zpinit. Bump 0.6.1 -> 0.6.2.
Add a service_manager custom fact (reports 'zpinit' when zpinit is the node's PID-1 supervisor, else 'supervisor') and make init.pp compute $supervisord::service_manager from it, with sc::service_manager as an optional explicit override. program.pp/install.pp/service.pp now read that single value instead of each doing its own lookup. Nodes built from the zpinit image are detected without any hiera key.
supervisord::config managed the daemon config dirs and notified supervisord::reload, whose supervisorctl reread/update execs then failed on zpinit nodes (no supervisorctl). A zpinit node has no supervisord daemon, so gate both classes on the detected backend the same way install.pp/service.pp already are. The classes stay declared so notify and anchor references keep resolving.
supervisorctl start/stop/remove used the bare program name whenever numprocs == 1. But a program with an explicit process_name containing %(process_num) is a homogeneous process group even at numprocs == 1, so the bare name is not addressable and supervisorctl reports 'no such process' on every run (e.g. messenger-worker-priority-low). Switch $pname to the ':*' group form when process_name templates the process number, not just when numprocs > 1. Supervisor-backend only; the zpinit branch is unaffected.
zpinit::service writes a TOML but does not load it into the running set; loading was happening only for programs that also have a Service[name] (via the zpinit Service provider's reread+update). Programs declared only as supervisord::program with no Service (cron, gitlab-runner, rundeck-node-consul-*) had their TOML written but never zpctl-updated, so they stayed unloaded until the next zpinit restart. Restore the global-reload step the supervisord backend has via supervisord::reload: on zpinit that class now runs 'zpctl update' (global config reload), and program.pp's zpinit branch notifies it on TOML change, mirroring the supervisord branch's notify. Refreshonly + idempotent.
0.6.6 had the dispatch shim notify supervisord::reload to run zpctl update on zpinit. That is the wrong layer: zpinit::service now triggers the reload itself on TOML change (zpinit 0.6.0). Restore supervisord::reload to a no-op on zpinit and drop the program.pp notify, so this module just dispatches and zpinit owns when zpinit reloads.
On zpinit nodes the supervisord daemon is not installed, so any leftover caller invoking supervisorctl (scripts, third-party tooling, cron jobs) fails with 'command not found'. Drop a /usr/local/bin/supervisorctl -> /usr/local/bin/zpctl symlink in supervisord::install's zpinit branch; zpctl implements the same verbs, so those callers transparently drive zpinit. Supervisor nodes are unaffected (else branch installs supervisord as before).
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.
This fixes #128. Changes to config or
supervisord::programresources should always be applied, regardless of how the service is managed.