diff options
author | Jean-Philippe Roemer <jp@roemer.im> | 2016-02-12 02:38:18 +0000 |
---|---|---|
committer | Jean-Philippe Roemer <jp@roemer.im> | 2016-02-12 02:48:55 +0000 |
commit | f4bc9263d97d55e811aeff383545fea7476105ba (patch) | |
tree | 178ba5334e7c9c0a3e10bffe51a666cf3b5cc3a0 /docker/start.sh | |
parent | 600d8edaca56ac9b74bd73c3625c17875ecb848e (diff) | |
download | gitea-f4bc9263d97d55e811aeff383545fea7476105ba.tar.gz gitea-f4bc9263d97d55e811aeff383545fea7476105ba.zip |
Add the ability to run crond inside the Docker container
- Add the crond init script for s6
- Add the RUN_CROND configuration variable to setup crond
- Crond will not be run by default (hence the `down` file in the service directory)
- `start.sh` check if RUN_CROND = "true" || "1" and remove this file to tell s6 to run the initscript
- Resolves #2597
Diffstat (limited to 'docker/start.sh')
-rwxr-xr-x | docker/start.sh | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/docker/start.sh b/docker/start.sh index 042bdd05d5..a54c2a9bfd 100755 --- a/docker/start.sh +++ b/docker/start.sh @@ -48,6 +48,15 @@ else create_socat_links fi +CROND=$(echo "$RUN_CROND" | tr '[:upper:]' '[:lower:]') +if [ "$CROND" = "true" -o "$CROND" = "1" ]; then + echo "init:crond | Cron Daemon (crond) will be run as requested by s6" 1>&2 + rm -f /app/gogs/docker/s6/crond/down +else + # Tell s6 not to run the crond service + touch /app/gogs/docker/s6/crond/down +fi + # Exec CMD or S6 by default if nothing present if [ $# -gt 0 ];then exec "$@" |