fixing cron in #602
Updated s6overlay to v3 Note: xz-utils was added as a requirement for s6-overlay (using safe 5.4.1 instead of compromised 5.6.x versions)pull/625/head
parent
5977f7c7d4
commit
f74d9c108a
@ -1,13 +1,25 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
#!/command/with-contenv bash
|
||||
|
||||
echo "waiting for scrutiny service to start"
|
||||
s6-svwait -u /var/run/s6/services/scrutiny
|
||||
# ensure not run (successfully) before
|
||||
if [ -f /tmp/custom-init-performed ]; then
|
||||
echo 'INFO: custom init already performed'
|
||||
s6-svc -D /run/service/collector-once # prevent s6 from restarting service
|
||||
exit 0
|
||||
fi
|
||||
|
||||
#tell s6 to only run this script once
|
||||
s6-svc -O /var/run/s6/services/collector-once
|
||||
echo "waiting for scrutiny service to start"
|
||||
s6-svwait -u /run/service/scrutiny
|
||||
|
||||
# wait until scrutiny is "Ready"
|
||||
until $(curl --output /dev/null --silent --head --fail http://localhost:8080/api/health); do echo "scrutiny api not ready" && sleep 5; done
|
||||
|
||||
echo "starting scrutiny collector (run-once mode. subsequent calls will be triggered via cron service)"
|
||||
/opt/scrutiny/bin/scrutiny-collector-metrics run
|
||||
|
||||
# prevent script's core logic from running again
|
||||
touch /tmp/custom-init-performed
|
||||
|
||||
# prevent s6 from restarting service
|
||||
s6-svc -D /run/service/collector-once
|
||||
|
||||
exit 0
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/execlineb -S0
|
||||
#!/command/execlineb -S0
|
||||
|
||||
echo "cron exiting"
|
||||
s6-svscanctl -t /var/run/s6/services
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
#!/command/with-contenv bash
|
||||
|
||||
echo "starting cron"
|
||||
cron -f -L 15
|
||||
|
Loading…
Reference in new issue