diff --git a/extra-repos/systemd/systemd/APKBUILD b/extra-repos/systemd/systemd/APKBUILD index e92adf5d2ff05a1224464d0f9c3a7ab44707aa59..1f21d4e4cb65cd43ef90207855de71ad3d6b7e6a 100644 --- a/extra-repos/systemd/systemd/APKBUILD +++ b/extra-repos/systemd/systemd/APKBUILD @@ -6,13 +6,29 @@ pkgname=systemd # currently tracking git MR pkgver=256.11 _pkgver="musl-v${pkgver//_/-}-split-usr" -pkgrel=1 +pkgrel=2 pkgdesc="System and service manager" url="https://github.com/systemd/systemd" arch="all !ppc64le !s390x" # blocked by pmboostrap not supporting license="MIT AND GPL-2.0-only AND LGPL-2.1-or-later" options="pmb:strict !check" # few tests fail, need to debug. We use alpine dbus for building, systemd-dbus for runtime +# FIXME: it turns out abuild doesn't let you have arbitrary triggers?! what century is this??? +# So we have to trigger everything on everything and do a bunch of reloading that +# isn't necessary most of the time... +triggers="$pkgname.trigger=/usr/lib/systemd/catalog:\ +/usr/lib/udev/hwdb.d:\ +/usr/lib/binfmt.d:\ +/usr/lib/sysusers.d:\ +/usr/lib/tmpfiles.d:\ +/usr/lib/udev/rules.d:\ +/usr/lib/sysctl.d:\ +/usr/lib/systemd/system:\ +/usr/lib/systemd/user:\ +/etc/systemd/system:\ +/etc/systemd/user +" + makedepends=" acl acl-dev @@ -269,7 +285,6 @@ udevd_zcomp() { timesyncd() { pkgdesc="systemd Time Synchronization" depends="$pkgname=$pkgver-r$pkgrel" - install="$subpkgname.post-install $subpkgname.pre-deinstall" amove etc/systemd/timesyncd.conf amove usr/bin/timedatectl @@ -279,6 +294,9 @@ timesyncd() { amove usr/share/dbus-1/system-services/org.freedesktop.timesync1.service amove usr/share/dbus-1/system.d/org.freedesktop.timesync1.conf amove usr/share/polkit-1/actions/org.freedesktop.timesync1.policy + + # Generate install scripts automatically for services in this subpackage + default_systemd_install_scripts } timesyncd_bcomp() { @@ -292,7 +310,6 @@ timesyncd_zcomp() { networkd() { pkgdesc="systemd Network Configuration" depends="$pkgname=$pkgver-r$pkgrel" - install="$subpkgname.post-install $subpkgname.pre-deinstall" amove usr/bin/networkctl amove etc/systemd/network @@ -314,6 +331,9 @@ networkd() { amove usr/share/polkit-1/actions/org.freedesktop.network1.policy install -D -m0644 "$srcdir/wired.network" "$subpkgdir/usr/lib/systemd/network/80-wired.network" + + # Generate install scripts automatically for services in this subpackage + default_systemd_install_scripts } networkd_bcomp() { @@ -327,7 +347,6 @@ networkd_zcomp() { resolved() { pkgdesc="systemd Network Name Resolution" depends="$pkgname=$pkgver-r$pkgrel" - install="$subpkgname.post-install $subpkgname.pre-deinstall" replaces="resolvconf" provides="resolvconf" @@ -342,6 +361,9 @@ resolved() { amove usr/share/dbus-1/system-services/org.freedesktop.resolve1.service amove usr/share/dbus-1/system.d/org.freedesktop.resolve1.conf amove usr/share/polkit-1/actions/org.freedesktop.resolve1.policy + + # Generate install scripts automatically for services in this subpackage + default_systemd_install_scripts } resolved_bcomp() { diff --git a/extra-repos/systemd/systemd/systemd-networkd.post-install b/extra-repos/systemd/systemd/systemd-networkd.post-install deleted file mode 100644 index 7090ed5a1d0168e21dce5fd308630500696b7244..0000000000000000000000000000000000000000 --- a/extra-repos/systemd/systemd/systemd-networkd.post-install +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -. /usr/lib/systemd/systemd-apk-macros.sh -systemd_service_post_install system systemd-networkd diff --git a/extra-repos/systemd/systemd/systemd-networkd.pre-deinstall b/extra-repos/systemd/systemd/systemd-networkd.pre-deinstall deleted file mode 100644 index fd99d8792c96b9cc9e5e053d891c0694490392c7..0000000000000000000000000000000000000000 --- a/extra-repos/systemd/systemd/systemd-networkd.pre-deinstall +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -. /usr/lib/systemd/systemd-apk-macros.sh -systemd_service_pre_deinstall system systemd-networkd diff --git a/extra-repos/systemd/systemd/systemd-resolved.post-install b/extra-repos/systemd/systemd/systemd-resolved.post-install deleted file mode 100644 index 2ecb0d2793875a614b0f2c2b0cc048f9d6b7f73c..0000000000000000000000000000000000000000 --- a/extra-repos/systemd/systemd/systemd-resolved.post-install +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -. /usr/lib/systemd/systemd-apk-macros.sh -systemd_service_post_install system systemd-resolved diff --git a/extra-repos/systemd/systemd/systemd-resolved.pre-deinstall b/extra-repos/systemd/systemd/systemd-resolved.pre-deinstall deleted file mode 100644 index c3623ded50ee0606f6f6503f36dd2e592b19ae0b..0000000000000000000000000000000000000000 --- a/extra-repos/systemd/systemd/systemd-resolved.pre-deinstall +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -. /usr/lib/systemd/systemd-apk-macros.sh -systemd_service_pre_deinstall system systemd-resolved diff --git a/extra-repos/systemd/systemd/systemd-timesyncd.post-install b/extra-repos/systemd/systemd/systemd-timesyncd.post-install deleted file mode 100644 index 43d4a4dda38b7dc1d31eda66821838984eb17a97..0000000000000000000000000000000000000000 --- a/extra-repos/systemd/systemd/systemd-timesyncd.post-install +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -. /usr/lib/systemd/systemd-apk-macros.sh -systemd_service_post_install system systemd-timesyncd diff --git a/extra-repos/systemd/systemd/systemd-timesyncd.pre-deinstall b/extra-repos/systemd/systemd/systemd-timesyncd.pre-deinstall deleted file mode 100644 index e93dc023801fad209efc28d652a4365896e4c2be..0000000000000000000000000000000000000000 --- a/extra-repos/systemd/systemd/systemd-timesyncd.pre-deinstall +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -. /usr/lib/systemd/systemd-apk-macros.sh -systemd_service_pre_deinstall system systemd-timesyncd diff --git a/extra-repos/systemd/systemd/systemd.trigger b/extra-repos/systemd/systemd/systemd.trigger new file mode 100644 index 0000000000000000000000000000000000000000..fabefeeba84b9ad030dcd13fe9e425825ac01823 --- /dev/null +++ b/extra-repos/systemd/systemd/systemd.trigger @@ -0,0 +1,62 @@ +#!/bin/sh + +# All the things we can do even if systemd isn't running + +# Update journald catalog +# FIXME: trigger only on /usr/lib/systemd/catalog +journalctl --update-catalog || : + +# Update the hwdb if it was modified +# FIXME: trigger only on /usr/lib/udev/hwdb.d +systemd-hwdb update || : + +# Process new sysusers +# FIXME: trigger only on /usr/lib/sysusers.d +systemd-sysusers || : + +# OK, if systemd isn't running then we're done, else we have more +# to do! + +if ! [ -d "/run/systemd/system" ]; then + exit 0 +fi + +# Can fail if binfmt_misc is not loaded +# FIXME: trigger only on /usr/lib/binfmt.d +/usr/lib/systemd/systemd-binfmt || : + +# Create new tmpfiles +# FIXME: trigger only on /usr/lib/tmpfiles.d +systemd-tmpfiles --create + +# FIXME: trigger only on /usr/lib/udev/rules.d +# We can't do this as a trigger for the udevd subpackage because it might +# end up running AFTER the systemd trigger. Urgh! +systemctl set-property systemd-udevd.service Markers=+needs-reload & + +# FIXME: trigger only on /usr/lib/sysctl.d +/usr/lib/systemd/systemd-sysctl || : + +# FIXME: the rest of this should trigger on. The system and user parts +# could trigger separately but the ordering is still important (systemd +# itself should be reloaded at the system and user level before services +# are reloaded or restarted). +# /usr/lib/systemd/system:/usr/lib/systemd/user:/etc/systemd/system:/etc/systemd/user + +# First do a system-wide daemon-reload +systemctl daemon-reload + +# And reload the user services. This doesn't do anything yet but will trigger +# a daemon-reexec once we upgrade to systemd 257. See +# https://github.com/systemd/systemd/commit/a375e145190482e8a2f0971bffb332e31211622f +systemctl reload "user@*.service" + +# Then reload or restart marked system units. Units get marked in their respective +# package post-upgrade scripts +systemctl reload-or-restart --marked + +users=$(systemctl list-units 'user@*' --legend=no | sed -n -r 's/.*user@([0-9]+).service.*/\1/p') +for user in $users; do + systemctl --user -M "$user@" reload-or-restart --marked & +done +wait