-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
31 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/usr/bin/env sh | ||
|
||
# NOTE: crond has to be invoked by root, otherwise it won't be able to run a job. | ||
# crontab files have to have uid=0, and it's impossible to do via chown with no | ||
# root privileges. So all the crond-related commands are in the entrypoint. | ||
|
||
INIT_DIR=/container-init.d | ||
CRONTABS=$INIT_DIR/crontabs | ||
BOOTSTRAP_SCRIPT=$INIT_DIR/010-pin-cids.sh | ||
|
||
if [ ! -e $CRONTABS ]; then mkdir -p $CRONTABS; fi | ||
if [ ! -e $BOOTSTRAP_SCRIPT ]; then echo "Make sure $BOOTSTRAP_SCRIPT is mounted" && exit 1; fi | ||
|
||
printf "@hourly timeout 600s $BOOTSTRAP_SCRIPT >&2\n" > $CRONTABS/ipfs | ||
echo "Starting crond" && /bin/crond -c$CRONTABS | ||
|
||
exec /usr/local/bin/start_ipfs "$@" |