Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DISCUSSION] d/needrestart-cloud-init.conf: skip automated restarts of cloud-final #5111

Conversation

blackboxsw
Copy link
Collaborator

Potential alternative to fixing upstream needrestart of downstream Ubuntu needrestart would be for cloud-init to deliver a conf file to skip automated restarts of cloud-final.service.

Proposed Commit Message

d/needrestart-cloud-init.conf: skip automated restarts of cloud-final

Install /etc/needrestart/conf.d/cloud-init.conf which will avoid automated needrestart of cloud-final.service when apt-get dist-upgrade also triggers a cloud-init package upgrade. The SIGTERM for cloud-final from needrestart prevents cloud-init from installing any deb packages or PPA source configuration after it invokes apt-get dist-upgrade leaving the system in a partially conigured state.

LP:# 2059337

Additional Context

Only Ubuntu Noble behaves this way per downstream Ubuntu modifications which put the needrestart mode into "autorestart" during non-interactive apt-get dist-upgrade calls that cloud-init executes.

https://bugs.launchpad.net/ubuntu/+source/needrestart/+bug/2059337

Test Steps




## Checklist
<!-- Go over all the following points, and put an `x` in all the boxes
that apply. -->
- [ ] My code follows the process laid out in [the documentation](https://cloudinit.readthedocs.io/en/latest/development/index.html)
- [ ] I have updated or added any [unit tests](https://cloudinit.readthedocs.io/en/latest/development/testing.html) accordingly
- [ ] I have updated or added any [documentation](https://cloudinit.readthedocs.io/en/latest/development/contribute_docs.html) accordingly

## Merge type

- [x] Squash merge using "Proposed Commit Message"
- [ ] Rebase and merge unique commits. Requires commit messages per-commit each referencing the pull request number (#<PR_NUM>)

Install /etc/needrestart/conf.d/cloud-init.conf which will avoid
automated needrestart of cloud-final.service when apt-get dist-upgrade
also triggers a cloud-init package upgrade. The SIGTERM for cloud-final
from needrestart prevents cloud-init from installing any deb packages
or PPA source configuration after it invokes apt-get dist-upgrade
leaving the system in a partially conigured state.

LP:# 2059337
@blackboxsw blackboxsw added wip Work in progress, do not land packaging Supplemental package review requested labels Mar 28, 2024
@blackboxsw
Copy link
Collaborator Author

In discussion with Ubuntu Foundations team, we don't ideally want individual packages to be delivering their own /etc/needrestart/conf.d supplements as those decisions about conditions under-which a systemd service needs to receive may change over time and forcing a package maintainer to extend their own configuration supplements may pin a service to avoid needrestart cases that are actually generally required. Ideally those default service skips defined in $nrconf{override_rc} should be promoted to the package upstream to represent these known restart skips in one place so they can have better visibility and be better maintained/updated by the needrestart package itself as new features are developed to better handle restart triggering conditions.

As such, I'm closing this PR in favor of a merge request directly against Ubuntu's needrestart which will skip cloud-*.services cdhttps://code.launchpad.net/~chad.smith/ubuntu/+source/needrestart/+git/needrestart/+merge/463236

@blackboxsw blackboxsw closed this Mar 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
packaging Supplemental package review requested wip Work in progress, do not land
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant