Create install.sh for root files (runsvdir-user)

This commit is contained in:
fanyx 2022-06-09 14:10:43 +02:00
parent 1cb0647e44
commit e1a5d59b06
3 changed files with 24 additions and 0 deletions

10
void-install/install-root.sh Executable file
View File

@ -0,0 +1,10 @@
#!/bin/sh
user= # insert your username here
sed -i -e "s/\@USER\@/$user/g" sv/runsvdir/run
install -d /etc/sv/runsvdir-$user
install -m755 sv/runsvdir/run /etc/sv/runsvdir-$user/run
install -m755 sv/runsvdir/finish /etc/sv/runsvdir-$user/finish
ln -sf /run/runit/supervise.runsvdir-$user /etc/sv/runsvdir-$user/supervise

View File

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

View File

@ -0,0 +1,8 @@
#!/bin/sh
USER=@USER@
HOME="home/$USER"
GROUPS="$(id -Gn "$USER" | tr ' ' ':')"
SVDIR="$HOME/sv"
exec chpst -u "$USER:$GROUPS" sh -l -c "exec runsvdir $SVDIR $USER" $USER