Merge ~ahasenack/ubuntu/+source/nfs-utils:hirsute-nfs-utils-restart-1928259 into ubuntu/+source/nfs-utils:ubuntu/hirsute-devel
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Andreas Hasenack | ||||
Approved revision: | b9d22b1788ca48200d58b3d7fc7a80c3a2eb6312 | ||||
Merged at revision: | b9d22b1788ca48200d58b3d7fc7a80c3a2eb6312 | ||||
Proposed branch: | ~ahasenack/ubuntu/+source/nfs-utils:hirsute-nfs-utils-restart-1928259 | ||||
Merge into: | ubuntu/+source/nfs-utils:ubuntu/hirsute-devel | ||||
Diff against target: |
29 lines (+11/-0) 2 files modified
debian/changelog (+7/-0) debian/nfs-common.postinst (+4/-0) |
||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Christian Ehrhardt (community) | Approve | ||
Dan Streetman | Pending | ||
Canonical Server | Pending | ||
Review via email: mp+403835@code.launchpad.net |
Description of the change
PPA: https:/
sudo add-apt-repository ppa:ahasenack/
To test, follow the testing procedure in the linked bug, or, for a more detailed test, the SRU bug #1927745 and confirm that rpc.gssd was restarted after the package upgrade (different pid).
This is an attempt to fix the linked bug in the less intrusive way possible, because I want to use the same fix for an SRU all the way back to bionic.
The goal of this fix is to mark nfs-utils.service as "started", so that the debhelper postinst section will correctly restart it on upgrade.
Key aspects of this fix:
- nfs-utils.service is a "fake" service meant to control other units that declare PartOf=
- PartOf only has effect on "stop" and "restart":
"""
PartOf=
Configures dependencies similar to Requires=, but limited to stopping and restarting of units. When systemd stops or restarts the units listed here, the action is propagated to this unit. Note that this is a one-way dependency — changes to this unit do not affect the listed units.
"""
This last bit is kind of crucial: it means that the "start" action has no effect on units linked via PartOf. It will just mark nfs-utils.service itself as being started (and it only runs /bin/true).
I tested this in some scenarios to make sure that the "start" action isn't starting anything by itself, and that remains true as far as I can see. The only thing that is flagged as started is nfs-utils.service itself, but just because of its RemainAfterExit
I also tested this when one of the services declaring PartOf=
Another test I did was if nfs-utils.service was masked. In that case, the postinst complained about it, didn't error, and no dependent services were restarted at the end of the package upgrade, which is what I expected.
Still, this is probably not the way upstream intended for this to work (these systemd service files come from upstream, and Debian and Fedora are also affected by this bug). But a bigger surgery on all these systemd service files is out of scope for the SRU.
Thank you Andreas, I generally agree to the discussion so far of 2not being the nicest, but the least invasive way". For the SRU that appears to be the right way.
The only yet umentioned test case IMHO was how it behaves after a system restart (as the test started rpc-gssd.service manually. But that worked fine. Also a disabled & stopped rpc-gssd.service behaved as expected (stayed shut down).
Thereby +1 to the proposed change