dotfiles/void-install/sv/runsvdir/run

14 lines
315 B
Plaintext
Raw Normal View History

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