Skip to content

ENT-14108: cf-execd.service: drain cf-agent on stop#6146

Open
larsewi wants to merge 1 commit into
cfengine:masterfrom
larsewi:drain-cf-agent-systemd
Open

ENT-14108: cf-execd.service: drain cf-agent on stop#6146
larsewi wants to merge 1 commit into
cfengine:masterfrom
larsewi:drain-cf-agent-systemd

Conversation

@larsewi
Copy link
Copy Markdown
Contributor

@larsewi larsewi commented May 27, 2026

KillMode=process only signals cf-execd. Any cf-agent spawned by cf-execd keeps running after systemctl stop returns. A mid-run agent can then re-trigger cf-php-fpm (Wants=cf-postgres), causing dependencies to be pulled back in after the stop was reported successful.

This fix adds ExecStopPost= that waits up to 60s for cf-agent to drain, then SIGKILLs any survivor. It runs after cf-execd has exited, so no new agents are spawned during the drain.

Ticket: ENT-14108

`KillMode=process` only signals cf-execd. Any cf-agent spawned by
cf-execd keeps running after systemctl stop returns. A mid-run agent can
then re-trigger cf-php-fpm (`Wants=cf-postgres`), causing dependencies
to be pulled back in after the stop was reported successful.

This fix adds `ExecStopPost=` that waits up to 60s for cf-agent to
drain, then `SIGKILL`s any survivor. It runs after cf-execd has exited,
so no new agents are spawned during the drain.

Ticket: ENT-14108
Changelog: cf-execd systemctl stop now waits for in-flight cf-agent to finish
Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
@larsewi
Copy link
Copy Markdown
Contributor Author

larsewi commented May 27, 2026

@cf-bottom Jenkins please :)

@larsewi larsewi added the cherry-pick? Fixes which may need to be cherry-picked to LTS branches label May 27, 2026
@cf-bottom
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cherry-pick? Fixes which may need to be cherry-picked to LTS branches

Development

Successfully merging this pull request may close these issues.

2 participants