mirror of
https://github.com/arthur-pbty/arthur-os.git
synced 2026-08-01 20:28:16 +02:00
Background gvfs restart to avoid blocking user.slice thaw
The post-sleep hook runs before systemd thaws user.slice, so a synchronous systemctl --user restart hangs for ~90 seconds waiting for the frozen user manager to respond — blocking the entire resume. Background the restart with a short delay so it executes after user.slice is thawed. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
a89c4f849d
commit
e490ca7d78
@@ -14,13 +14,18 @@ if [[ $1 == "pre" ]]; then
|
||||
fi
|
||||
|
||||
if [[ $1 == "post" ]]; then
|
||||
for uid_dir in /run/user/*; do
|
||||
uid=$(basename "$uid_dir")
|
||||
if [[ -S $uid_dir/bus ]]; then
|
||||
sudo -u "#$uid" \
|
||||
DBUS_SESSION_BUS_ADDRESS="unix:path=$uid_dir/bus" \
|
||||
XDG_RUNTIME_DIR="$uid_dir" \
|
||||
systemctl --user restart gvfs-daemon.service 2>/dev/null || true
|
||||
fi
|
||||
done
|
||||
# Run in background — user.slice is still frozen at this point, so a
|
||||
# synchronous restart would block the thaw for up to 90 seconds.
|
||||
(
|
||||
sleep 5
|
||||
for uid_dir in /run/user/*; do
|
||||
uid=$(basename "$uid_dir")
|
||||
if [[ -S $uid_dir/bus ]]; then
|
||||
sudo -u "#$uid" \
|
||||
DBUS_SESSION_BUS_ADDRESS="unix:path=$uid_dir/bus" \
|
||||
XDG_RUNTIME_DIR="$uid_dir" \
|
||||
systemctl --user restart gvfs-daemon.service 2>/dev/null || true
|
||||
fi
|
||||
done
|
||||
) &
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user