SIGTERM now stops crond
This means `docker stop` will be faster
This commit is contained in:
parent
ab6372fa79
commit
990ee018d2
1 changed files with 13 additions and 1 deletions
|
@ -27,4 +27,16 @@ echo "$containerId" > /tmp/containerId
|
|||
echo "*/$NEXTCLOUD_CRON_MINUTE_INTERVAL * * * * /cron-tasks.sh $containerId" \
|
||||
> /var/spool/cron/crontabs/root
|
||||
|
||||
exec crond -f -l 0 -L /dev/stdout
|
||||
# Watch for SIGTERM (someone stops the docker container) so we can tell crond to exit
|
||||
_term() {
|
||||
echo "Caught SIGTERM signal!"
|
||||
kill -TERM "$child" 2>/dev/null
|
||||
}
|
||||
|
||||
trap _term SIGTERM
|
||||
|
||||
exec crond -f -l 0 &
|
||||
echo "Started crond"
|
||||
|
||||
child=$!
|
||||
wait "$child"
|
||||
|
|
Loading…
Reference in a new issue