2022-08-20 03:20:49 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
# Fix for windows hosts manging run files
|
|
|
|
dos2unix /etc/service/*/run
|
|
|
|
|
|
|
|
# Fix permissions on run files
|
|
|
|
chmod +x /etc/service/*/run
|
|
|
|
|
2022-09-01 13:28:13 +00:00
|
|
|
# Define shutdown + cleanup procedure
|
|
|
|
cleanup() {
|
|
|
|
echo "Container stop requested, running final dump + cleanup"
|
|
|
|
/sync/sync --push
|
|
|
|
echo "Good bye!"
|
|
|
|
}
|
|
|
|
|
|
|
|
# Trap SIGTERM
|
|
|
|
echo "Setting SIGTERM trap"
|
|
|
|
trap 'cleanup' EXIT SIGINT
|
|
|
|
trap 'echo SIGQUIT' SIGQUIT
|
|
|
|
|
2022-08-20 03:20:49 +00:00
|
|
|
# Start Runit.
|
|
|
|
echo "Starting Runit."
|
|
|
|
runsvdir -P /etc/service
|