initial import

This commit is contained in:
2025-06-22 20:39:04 -05:00
commit f8a70886f0
3428 changed files with 302546 additions and 0 deletions

44
runit/runit-hook Normal file
View File

@@ -0,0 +1,44 @@
#!/bin/sh -e
runit_live() {
if [ ! -L /var/service ]; then
echo >&2 " Skipped: Current root is not booted."
exit 0
fi
}
svc_help(){
echo " ==> Start/stop/restart a service:"
echo " sv <start/stop/restart> <service>"
}
svc_add_help(){
echo " ==> Add a service:"
echo " ln -s /etc/sv/<service> /var/service"
svc_help
}
svc_del_help(){
echo " ==> Remove a service:"
echo " rm /var/service/<service>"
svc_help
}
each_conf() {
while read -r f; do
"$@" "/$f"
done
}
op="$1"; shift
case $op in
sysctl) runit_live; each_conf /sbin/sysctl -q -p ;;
# For use by other packages
reload) runit_live; /usr/bin/sv "$@" reload ;;
add) svc_add_help ;;
del) svc_del_help ;;
*) echo >&2 " Invalid operation '$op'"; exit 1 ;;
esac
exit 0