Restart active OWE user services after upgrades (#888)
This commit is contained in:
1 parent
3e4cb2308e
commit
f3e71f8a13
5 files changed
+134
-3
No files matched your search
@@ -0,0 +1,9 @@
|
||||
[Trigger]
|
||||
Operation = Upgrade
|
||||
Type = Package
|
||||
Target = owe
|
||||
|
||||
[Action]
|
||||
Description = Restarting active OWE user services...
|
||||
When = PostTransaction
|
||||
Exec = /usr/lib/owe/package-restart
|
||||
@@ -1,7 +1,7 @@
|
||||
# Maintainer: owe contributors
|
||||
pkgname=owe
|
||||
pkgver=0.2.10
|
||||
pkgrel=3
|
||||
pkgrel=4
|
||||
pkgdesc="High-performance wallpaper engine for Omarchy (mp4, gif, stills)"
|
||||
arch=('x86_64' 'aarch64')
|
||||
url="https://github.com/omacom/owe"
|
||||
@@ -12,9 +12,13 @@ checkdepends=('python')
|
||||
optdepends=('intel-media-driver: VAAPI hardware decode on Intel GPUs'
|
||||
'libva-mesa-driver: VAAPI hardware decode on AMD GPUs')
|
||||
source=("$pkgname-$pkgver.tar.gz::https://github.com/omacom/owe/archive/refs/tags/v$pkgver.tar.gz"
|
||||
'lock-policy-timestamp.patch')
|
||||
'lock-policy-timestamp.patch'
|
||||
'90-owe-restart.hook'
|
||||
'package-restart')
|
||||
sha256sums=('b171397c24c0ffd6096781b3f744f674055a57f660a74db07a3b71a111a6980b'
|
||||
'3ebf413093922b0917bca60c42720c6424c77b1695317364bf73f9fd745376d8')
|
||||
'3ebf413093922b0917bca60c42720c6424c77b1695317364bf73f9fd745376d8'
|
||||
'aee4a08132f0528575d3b7364defc070b8af1648cc48559238ba089c09504b62'
|
||||
'ef1fc780425343623c4a4ddd36cc58cd89ba8a71c528641f4b421db834a349cd')
|
||||
|
||||
prepare() {
|
||||
cd "$srcdir/owe-$pkgver"
|
||||
@@ -43,6 +47,8 @@ check() {
|
||||
|
||||
package() {
|
||||
DESTDIR="$pkgdir" ninja -C build install
|
||||
install -Dm644 "$srcdir/90-owe-restart.hook" "$pkgdir/usr/share/libalpm/hooks/90-owe-restart.hook"
|
||||
install -Dm755 "$srcdir/package-restart" "$pkgdir/usr/lib/owe/package-restart"
|
||||
install -d "$pkgdir/usr/lib/systemd/user"
|
||||
sed 's|%h/.local/bin/owed|/usr/bin/owed|' "$srcdir/owe-$pkgver/systemd/owed.service" \
|
||||
>"$pkgdir/usr/lib/systemd/user/owed.service"
|
||||
|
||||
Executable
+21
@@ -0,0 +1,21 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Run after systemd's 30-systemd-daemon-reload-user.hook. Image builds and
|
||||
# offline installations have no running managers and must remain untouched.
|
||||
if systemd-detect-virt --chroot || ! systemd-notify --booted; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
managers=$(systemctl list-units 'user@*.service' --state=running --no-legend --plain) || exit 1
|
||||
result=0
|
||||
while read -r unit _; do
|
||||
[[ $unit =~ ^user@([0-9]+)\.service$ ]] || continue
|
||||
user_id=${BASH_REMATCH[1]}
|
||||
# Use the user's manager rather than pacman's root session. try-restart
|
||||
# never starts a stopped service or changes its enablement.
|
||||
if ! systemctl --user --machine="$user_id@.host" try-restart owed.service; then
|
||||
echo ":: Could not restart OWE for user $user_id; restart owed.service in that user session." >&2
|
||||
result=1
|
||||
fi
|
||||
done <<< "$managers"
|
||||
exit "$result"
|
||||
Reference in new issue
Block a user