migrate_node_to_cinc: don't let needrestart hang the migration #719

Merged
greg merged 1 commits from fix/migrate-cinc-noninteractive into master 2026-12-04 13:23:44 +00:00
Owner

The migration script runs its payload over SSH with no TTY, but needrestart's apt hook runs in its default interactive mode (via debconf) after installing or removing packages, so it blocks forever waiting on a prompt. This stalled the garage-14 migration during apt-get remove chef and had to be cleared by hand.

Export DEBIAN_FRONTEND=noninteractive and NEEDRESTART_SUSPEND=1 at the top of the generated remote script, so no invocation flags are needed. The needrestart hook then exits early ("needrestart is suspended") and dpkg/apt can't prompt. This covers both the Cinc install and the apt-get remove chef steps.

Confirmed from the hook source (/usr/lib/needrestart/apt-pinvoke, needrestart 3.5) that a non-empty NEEDRESTART_SUSPEND makes it skip needrestart entirely.

Fixes #711.

The migration script runs its payload over SSH with no TTY, but needrestart's apt hook runs in its default interactive mode (via debconf) after installing or removing packages, so it blocks forever waiting on a prompt. This stalled the garage-14 migration during `apt-get remove chef` and had to be cleared by hand. Export `DEBIAN_FRONTEND=noninteractive` and `NEEDRESTART_SUSPEND=1` at the top of the generated remote script, so no invocation flags are needed. The needrestart hook then exits early ("needrestart is suspended") and dpkg/apt can't prompt. This covers both the Cinc install and the `apt-get remove chef` steps. Confirmed from the hook source (`/usr/lib/needrestart/apt-pinvoke`, needrestart 3.5) that a non-empty `NEEDRESTART_SUSPEND` makes it skip needrestart entirely. Fixes #711.
raucao added 1 commit 2026-12-04 11:43:12 +00:00
migrate_node_to_cinc: don't let needrestart hang the migration
kosmos/actions: Required labels / Required labels (pull_request) Successful in 11s
09343cde51
The script runs over SSH with no TTY, but needrestart's apt hook runs in
its default interactive mode (via debconf) after installing or removing
packages, so it blocks forever waiting on a prompt. That stalled the
garage-14 migration during `apt-get remove chef`.

Export DEBIAN_FRONTEND=noninteractive and NEEDRESTART_SUSPEND=1 inside the
generated remote script so no invocation flags are needed. The needrestart
hook exits early ("needrestart is suspended") and dpkg/apt can't prompt.
raucao added the dev environmentkredits-1ops labels 2026-12-04 11:51:15 +00:00
raucao requested review from greg 2026-12-04 11:55:35 +00:00
raucao removed the kredits-1 label 2026-12-04 13:11:35 +00:00
raucao added the kredits-1 label 2026-12-04 13:17:05 +00:00
greg approved these changes 2026-12-04 13:23:10 +00:00
greg left a comment
Owner

👍

👍
greg merged commit 179620b163 into master 2026-12-04 13:23:44 +00:00
greg deleted branch fix/migrate-cinc-noninteractive 2026-12-04 13:23:44 +00:00
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: kosmos/chef#719