migrate_node_to_cinc: don't let needrestart hang the migration #719
Labels
Clear labels
monitoring
bug
design
dev environment
docs
duplicate
enhancement
feature
good first issue
idea
invalid
kredits-1
kredits-2
kredits-3
on hold
ops
question
security
ui/ux
wontfix
Infrastructure metrics, alerts, notifications, etc.
service
discourse
Kosmos Community Forums
service
accounts
Kosmos Accounts
service
drone-ci
Kosmos Drone CI
service
email
mail.kosmos.org
service
garage
S3-compatible object storage
service
gitea
Kosmos Gitea
service
ipfs
Kosmos IPFS
service
lightning
Lightning address, lndhub, etc.
service
mastodon
kosmos.social
service
nostr
Relays, Blossom server, etc.
service
postgres
Database cluster
service
remotestorage
Portable data storage for the Web
service
wiki
Kosmos Wiki
service
xmpp
Kosmos Chat
Something is not working
Graphic/visual design
Config, builds, CI, deployment, etc.
Documentation
This issue or pull request already exists
Improving existing functionality
New functionality
Dive in, and start contributing
Something to consider
Not a bug
Small contribution
Medium contribution
Large contribution
Currently not actionable
Manual IT ops activities
Looking for an answer
All your base are belong to us
User interface, process design, etc.
This won't be fixed
release
major
release
minor
release
patch
Milestone
No items
No Milestone
Projects
Clear projects
No projects
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: kosmos/chef#719
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
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 chefand had to be cleared by hand.Export
DEBIAN_FRONTEND=noninteractiveandNEEDRESTART_SUSPEND=1at 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 theapt-get remove chefsteps.Confirmed from the hook source (
/usr/lib/needrestart/apt-pinvoke, needrestart 3.5) that a non-emptyNEEDRESTART_SUSPENDmakes it skip needrestart entirely.Fixes #711.
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.👍