dotfiles/void-install/sv/runsvdir/run

17 lines
355 B
Plaintext
Raw Permalink Normal View History

#!/bin/sh
ZUSER=@USER@
2024-02-21 14:54:03 +01:00
ID=$(id -u $ZUSER)
GROUPS=$(id -Gn "$ZUSER" | tr ' ' ':')
2024-02-21 14:54:03 +01:00
export HOME="/home/$ZUSER"
SVDIR="$HOME/sv"
2024-02-21 14:54:03 +01:00
export XDG_RUNTIME_DIR="/run/user/$ID"
2022-07-12 12:30:59 +02:00
[ ! -d /run/user/$ID ] && \
2024-02-21 14:54:03 +01:00
mkdir -p $XDG_RUNTIMEDIR && \
chown $ZUSER:$ZUSER $XDG_RUNTIME_DIR
2022-07-12 12:30:59 +02:00
exec chpst -u "$ZUSER:$GROUPS" sh -l -c "exec runsvdir $SVDIR $ZUSER '...'" $ZUSER