DRAFT: systemd/postmarketos-base-systemd: add trigger to run preset-all
This adds a trigger to postmarketos-base-systemd that runs
systemctl preset-all
any time unit files are changed on the system.
This means we can drop the systemd macro for pkg pre-install/de-install
scripts, and avoid making abuild complicated for handling systemd stuff.
The downside with this approach is that users who want to permanently
disable can no longer do systemctl disable <unit>
, and instead have
to do systemctl mask <unit>
. Given how much this improves other stuff,
especially wrt upstreaming the abuild split func stuff, I think this
is a worthwhile trade-off. We can always improve on this more in the
future, since this trigger thing would be easy to rollback/replace.
fixes #3494 (closed)
Also see: #3476 Also see: #2804
@jane400 @caleb @whynothugo @pabloyoyoista : Your input would be appreciated
TODO:
-
What about cleaning up links made from systemd preset that are broken after a pkg providing the enabled unit file was removed? This could be copied from the systemd macro's pre-deinstall func and included in the trigger somehow? -
Should this also run systemctl daemon-reload
?
Merge request reports
Activity
Packages you maintain have been changed: @jane400 @jane400 @ollieparanoid @caleb @caleb
A major benefit of this is that the only thing we'd need to patch abuild for is the original split -systemd subpkg patch, which upstream said was fine here: https://gitlab.alpinelinux.org/alpine/abuild/-/merge_requests/272#note_443245
And, this would also make !6120 (merged) (which adds more complexity) unnecessary because #3494 (closed) is no longer a problem with this tigger approach.
Edited by Clayton Craftadded 1 commit
- a335bb83 - DRAFT: systemd/postmarketos-base-systemd: add trigger to run preset-all
1 #!/bin/sh 2 3 # system units 4 systemctl preset-all 5 6 # session/user units 7 systemctl --global preset-all 8 9 cat <<EOF 10 --------------------------------------------------------------------------------------------------------- 11 HINT: To permanently DISABLE a systemd unit, use: systemctl mask <unit> 12 HINT: To permanently ENABLE a systemd unit, add a preset for it in the appropriate /etc/systemd/*-preset 2 2 # Co-maintainer: Clayton Craft <clayton@craftyguy.net> 3 3 # pmbootstrap installs this, if systemd is selected in "pmbootstrap init". 4 4 pkgname=postmarketos-base-systemd 5 pkgver=27 6 pkgrel=0 5 pkgver=28 6 pkgrel=1 7 7 pkgdesc="Meta package for running postmarketOS with systemd" 8 8 url="https://postmarketos.org" 9 9 arch="noarch" 10 10 license="GPL-3.0-or-later" 11 11 options="!check" 12 triggers="$pkgname.trigger=/usr/lib/systemd/*" Wow, this is really nice! I think this might be quite a sensible baby-step to get things moving without creating pressure upstream. Ideally, we'd be able to get rid of this if alpine ever accepts systemd, and then things could be made more streamlined/consistent with what others do. But from the collaboration side, this will make things a lot easier now. Whether this is a sensible trade-off technically, that I'll leave to those of you that can judge it to decide
Edited by Pablo Correa Gomezmentioned in issue #2804
Summarising my thoughts having talked this over with Clayton a few times: I think this is misusing systemd presets and service masking, and will be not fun to deal with later (especially any path to migrate to a "proper" preset implementation as other distros have). I think it's best to hold off on this route until other avenues are exhausted, specifically until:
a) Alpine refuse to work with us to find a solution to support presets in upstream abuild (something that seems unlikely at this moment) b) if a) that maintaining the systemd-services package also becomes unsustainable
added status::mr-stale label
Sorry to bother you @craftyguy,
but we've detected that this merge request hasn't seen any recent activity. If you need help, want to discuss your approach with developers, or you are all done and this is waiting for review, you can ping
@postmarketOS
. You can also ask on matrix in #devel:postmarketos.org or #postmarketos-devel on OFTC.Thanks for your contribution.
This has basically been replaced by !6334 (merged)