Add XDG_RUNTIME_DIR to void-install

This commit is contained in:
fanyx 2024-02-21 14:54:03 +01:00
parent 07823387dc
commit d22ed57969
1 changed files with 8 additions and 5 deletions

View File

@ -1,13 +1,16 @@
#!/bin/sh
ZUSER=@USER@
export HOME="/home/$ZUSER"
GROUPS=$(id -Gn "$ZUSER" | tr ' ' ':')
SVDIR="$HOME/sv"
ID=$(id -u $ZUSER)
GROUPS=$(id -Gn "$ZUSER" | tr ' ' ':')
export HOME="/home/$ZUSER"
SVDIR="$HOME/sv"
export XDG_RUNTIME_DIR="/run/user/$ID"
[ ! -d /run/user/$ID ] && \
mkdir -p /run/user/$ZUSER && \
chown $ZUSER:$ZUSER /run/user/$ZUSER
mkdir -p $XDG_RUNTIMEDIR && \
chown $ZUSER:$ZUSER $XDG_RUNTIME_DIR
exec chpst -u "$ZUSER:$GROUPS" sh -l -c "exec runsvdir $SVDIR $ZUSER '...'" $ZUSER