1
0
Fork 0

Revert "remove user sv"

This reverts commit 2bd07f69e5.
This commit is contained in:
Luca Bilke 2024-02-04 13:04:53 +01:00
parent 429c209837
commit cdc6e7ad77
No known key found for this signature in database
GPG Key ID: AD6630D0A1E650AC
2 changed files with 19 additions and 0 deletions

View File

@ -194,6 +194,16 @@ select_keymap() {
}
enable_services() {
tput sc
info "Installing user service service..."
target="/etc/sv/runsvdir-${username}"
mkdir -p "$target"
sed "s/<U>/$username/" "${SCRIPT_DIR}/runsvdir-user" >"$target/run"
[ ! -L "/var/service/$(basename "$target")" ] &&
ln -s "$target" "/var/service/"
chmod 755 "$target"
tput rc
tput el
#shellcheck disable=SC2016
_loop_wrapper "$1" \
'Enabling ${x} service' \

9
runsvdir-user Normal file
View File

@ -0,0 +1,9 @@
#!/bin/sh
export USER="<U>"
export HOME="/home/<U>"
groups="$(id -Gn "$USER" | tr ' ' ':')"
svdir="$HOME/.local/sv/"
exec chpst -u "$USER:$groups" runsvdir "$svdir"