3 Commits
2.3 ... 2.4

Author SHA1 Message Date
faca7dbca1 dinit: fix user spawn handling in chroot 2025-08-15 17:28:11 +02:00
1f78e5fa1c dinit: handle user spawn in chroot 2025-08-15 16:55:18 +02:00
e5e819e337 dinit: add user spawn install & remove hooks 2025-08-15 16:16:02 +02:00
3 changed files with 32 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
[Trigger]
Type = Path
Operation = Install
# Operation = Upgrade
Target = usr/lib/dinit.d/dinit-user-spawn
[Action]
Description = Enabling dinit user spawn ...
When = PostTransaction
Exec = /usr/share/libalpm/scripts/dinit-hook userspawnE
NeedsTargets

View File

@@ -0,0 +1,10 @@
[Trigger]
Type = Path
Operation = Remove
Target = usr/lib/dinit.d/dinit-user-spawn
[Action]
Description = Disabling dinit user service help ...
When = PostTransaction
Exec = /usr/share/libalpm/scripts/dinit-hook userspawnD
NeedsTargets

View File

@@ -54,6 +54,15 @@ restart_service() {
fi
}
handle_user_spawn() {
if [ ! -S /run/dinitctl ]; then
echo >&2 " Current root is not booted."
dinitctl "$1" -o dinit-user-spawn
else
dinitctl "$1" dinit-user-spawn
fi
}
op="$1"; shift
case $op in
@@ -66,6 +75,8 @@ case $op in
del) svc_del_help ;;
addU) svc_user_add_help ;;
delU) svc_user_del_help ;;
userspawnE) handle_user_spawn enable ;;
userspawnD) handle_user_spawn disable ;;
*) echo >&2 " Invalid operation '$op'"; exit 1 ;;
esac