I’m trying to run supercronic. I followed Crontab with Supercronic · Fly Docs to add supercronic to the dockerfile etc.
Running supercronic /path/to/crontab
exits immediately, and the machine shuts down. If I try to restart it, it shuts down again.
I tried adding a every-minute cronjob to see if the machine would magically restart itself, but it does not.
- Is the
supercronic
process supposed toexit 0
? If not, what other settings do I need to keep it alive? - What do I need to do to keep a specific process’ machine which is not http_service alive at all times?
Some debug info
2024-01-23T22:12:30Z app[91857e72a96448] sea [info] INFO Preparing to run: `/rails/bin/docker-entrypoint bundle exec whenever > crontab && supercronic crontab` as 1000
2024-01-23T22:12:30Z app[91857e72a96448] sea [info] INFO [fly api proxy] listening at /.fly/api
2024-01-23T22:12:30Z app[91857e72a96448] sea [info]2024/01/23 22:12:30 listening on [fdaa:4:e9ed:a7b:124:8244:dd91:2]:22 (DNS: [fdaa::3]:53)
2024-01-23T22:12:31Z app[91857e72a96448] sea [info]0 0 * * * /bin/bash -l -c 'cd /rails && RAILS_ENV=production bundle exec rake update_genome --silent'
2024-01-23T22:12:31Z app[91857e72a96448] sea [info]0 0 * * * /bin/bash -l -c 'cd /rails && RAILS_ENV=production bundle exec rake db_dump --silent'
2024-01-23T22:12:31Z app[91857e72a96448] sea [info]* * * * * /bin/bash -l -c 'echo '\''Testing Testing Testing Testing Testing Testing Testing Testing Testing Testing '\'''
2024-01-23T22:12:31Z app[91857e72a96448] sea [info]## [message] Above is your schedule file converted to cron syntax; your crontab file was not updated.
2024-01-23T22:12:31Z app[91857e72a96448] sea [info]## [message] Run `whenever --help' for more options.
2024-01-23T22:12:31Z app[91857e72a96448] sea [info] INFO Main child exited normally with code: 0
2024-01-23T22:12:31Z app[91857e72a96448] sea [info] INFO Starting clean up.
2024-01-23T22:12:31Z app[91857e72a96448] sea [info] WARN hallpass exited, pid: 306, status: signal: 15 (SIGTERM)
fly.toml
app = "frdm-pr-preview" # will be overwritten
primary_region = "sea"
swap_size_mb = 1024
console_command = "/rails/bin/rails console"
[build]
[deploy]
release_command = "./bin/rails db:migrate"
[processes]
app = "./bin/rails server"
cron = "bundle exec whenever > crontab && supercronic crontab"
[http_service]
internal_port = 3000
force_https = true
auto_stop_machines = false
auto_start_machines = true
min_machines_running = 1
processes = ["app"]
[[vm]]
cpu_kind = "shared"
cpus = 1
memory_mb = 256
processes = ["app", "sidekiq", "cron"]
[[statics]]
guest_path = "/rails/public"
url_prefix = "/"
[env]
SECRET_KEY_BASE = "..."