Skip to content
Snippets Groups Projects

systemd: refactor apk macros and add reload/restart support

Merged Casey requested to merge caleb/systemd-abuild-take4 into master

Refactor the apk macros script so that it may be embedded by abuild into the .post-install/.pre-deinstall/.post-upgrade script of a -systemd subpackage.

Additionally, implement the post-upgrade feature of reloading or restarting services.

build on @craftyguy's earlier efforts to generate the install script(s) automatically. This brings the following features:

  1. embed everything into the script, no calling out to arbitrary code at package install/upgrade time. This is more reliable since changes to the script will only apply when packages are upgraded (this is how every other distro does it).
  2. detect services that need to be reloaded automatically
  3. add calls to systemctl disable for EVERY service during de-install, not just the ones with [Install] sections (FIXME: is this actually correct? may have been a brain fart...)
  4. support specifying systemd_system_units_restart= / systemd_user_units_restart= in the systemd subpackage, units listed will be restarted on package upgrade (useful for stuff like apache/nginx/cups. Fedora and Debian do this too)
  5. disallow defining custom install scripts for -systemd subpackages. This ought not be needed and makes the abuild changes simpler. It could be added if highly desirable, but maybe that can come in the future if there is demand.
  6. Add triggers to the systemd package to handle actually reloading/restarting marked units, as well as reloading udev, sysusers, tmpfiles, sysctl and some other stuff. This is broken because triggers are way more limited than I thought...

This is mostly untested, opening for reference/review

The abuild branch can be found here: https://gitlab.alpinelinux.org/craftyguy/abuild/-/merge_requests/2

TODO:

  • fixup everything still using the old systemd-apk-macros script, these packages won't build anymore.
  • Solve the issue with triggers, we need multiple triggers on different dirs that are run in a consistent order! can't be solved without modifying apk-tools, so all trigger actions are in 1 trigger
Edited by Clayton Craft

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
Please register or sign in to reply
Loading