RFC: disable service start/stop for offline updates

Authored by sitter on Nov 26 2018, 1:07 PM.



during offline updates we run in a minimal system with few services started
and we do actually not want to start any additional services. because of
the minimal nature this may also result in services timing out as they
won't be able to bind network interfaces or any other reason really.
to that end prevent any services from even attempting to start by
installing a policy-rc.d will prevent offline updates for getting stuck
for 90 or so seconds until a service may decide to fail starting.

system-update.target wants a special helper which binds our policy-rc.d
into place, default.target may clean up an empty policy-rc.d if
should the user have a policy-rc.d we'll not destroy them, and thanks
to the bind mount our override will not persist across the reboot out of
system-update.target. the ultimate target is an ephemeral policy-rc.d.

Test Plan

did an update. policy-rc.d was managed as described

Diff Detail

No Linters Available
No Unit Test Coverage
Build Status
Buildable 5382
Build 5400: arc lint + arc unit
sitter requested review of this revision.Nov 26 2018, 1:07 PM
sitter created this revision.
jriddell accepted this revision.Feb 11 2019, 5:34 PM

Are we still interested in offline updates?

when debuild neon-settings with this patch I get an error
dh_systemd_start --no-start neon-packagekit-offline-update-policy
dh_systemd_start: Requested unit "neon-packagekit-offline-update-policy" but it was not found in any package acted on.
dh_systemd_start: Could not handle all of the requested services

The lines in debian/rules need ".service" added to the end

can't say I've heard of policy-rc.d before and I'm a bit confused why a script has a name ending in .d but some explanation at https://major.io/2016/05/05/preventing-ubuntu-16-04-starting-daemons-package-installed/ and this seems a sensible approach. I also didn't know mount --bind could work on files as well as disk images. So new stuff all round. But given these tools it seems like a sensible approach.

This revision is now accepted and ready to land.Feb 11 2019, 5:34 PM

! In D17172#410063, @jriddell wrote:
Are we still interested in offline updates?

Well, considering users got annoyed with Qt upgrade breaking their lock screen only last week, yes ;)

sitter closed this revision.Feb 14 2019, 10:37 AM

Seeing as offline updates are opt-in this addition should have no current impact on anything outside opt-in offline updates. So, fine to land one presumes.