fixes to void-install runsvdir templates

This commit is contained in:
fanyx 2023-06-08 16:54:24 +02:00
parent 20cc076a54
commit 7dc0c5cb23
2 changed files with 10 additions and 10 deletions

6
void-install/sv/runsvdir/finish Normal file → Executable file
View File

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
user=@USER@ ZUSER=@USER@
sv -w600 force-stop /home/$user/sv/* sv -w600 force-stop /home/$ZUSER/sv/*
sv exit /home/$user/sv/* sv exit /home/$ZUSER/sv/*

14
void-install/sv/runsvdir/run Normal file → Executable file
View File

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