Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exit status #36

Closed
n-rodriguez opened this issue Apr 7, 2023 · 1 comment · Fixed by #37
Closed

Exit status #36

n-rodriguez opened this issue Apr 7, 2023 · 1 comment · Fixed by #37

Comments

@n-rodriguez
Copy link
Contributor

n-rodriguez commented Apr 7, 2023

When the container/go-crond is stopped the exit status is 1 :

-----> Setup log archives directories
=====> Executing command: go-crond --allow-unprivileged --include=/etc/cron.d --log.json --server.bind=0.0.0.0:8080
{"level":"info","msg":"starting go-crond version 23.2.0 (868c01d; go1.19.6) ","time":"2023-04-07T02:58:32+02:00"}
{"level":"info","msg":"{\"ShowVersion\":false,\"ShowOnlyVersion\":false,\"ShowHelp\":false,\"Cron\":{\"DefaultUser\":\"root\",\"IncludeCronD\":[\"/etc/cron.d\"],\"Auto\":false,\"RunParts\":null,\"RunParts1m\":null,\"RunParts15m\":null,\"RunPartsHourly\":null,\"RunPartsDaily\":null,\"RunPartsWeekly\":null,\"RunPartsMonthly\":null,\"AllowUnprivileged\":true,\"WorkDir\":\"/\",\"EnableUserSwitching\":false},\"Log\":{\"Verbose\":false,\"Json\":true},\"Server\":{\"Bind\":\"0.0.0.0:8080\",\"ReadTimeout\":5000000000,\"WriteTimeout\":10000000000,\"Metrics\":false},\"Args\":{\"Crontabs\":null}}","time":"2023-04-07T02:58:32+02:00"}
{"level":"warning","msg":"go-crond is NOT running as root, disabling user switching","time":"2023-04-07T02:58:32+02:00"}
{"level":"info","msg":"starting http server on 0.0.0.0:8080","time":"2023-04-07T02:58:32+02:00"}
{"command":"/app/bin/concerto-cli postgres reindex --env_file /app/.env --version_file /app/VERSION \u003e /proc/1/fd/1 2\u003e\u00261","crontab":"/etc/cron.d/concerto","level":"info","msg":"cronjob added","shell":"/bin/bash","spec":"00 3 * * 0","time":"2023-04-07T02:58:32+02:00","user":"nonroot"}
{"command":"/app/bin/concerto-cli postgres vacuum --env_file /app/.env --version_file /app/VERSION --full \u003e /proc/1/fd/1 2\u003e\u00261","crontab":"/etc/cron.d/concerto","level":"info","msg":"cronjob added","shell":"/bin/bash","spec":"45 3 * * 0","time":"2023-04-07T02:58:32+02:00","user":"nonroot"}
{"command":"/app/bin/concerto-cli postgres vacuum --env_file /app/.env --version_file /app/VERSION \u003e /proc/1/fd/1 2\u003e\u00261","crontab":"/etc/cron.d/concerto","level":"info","msg":"cronjob added","shell":"/bin/bash","spec":"45 3 * * 1-6","time":"2023-04-07T02:58:32+02:00","user":"nonroot"}
{"command":"/app/bin/concerto-cli postgres backup --env_file /app/.env --version_file /app/VERSION \u003e /proc/1/fd/1 2\u003e\u00261","crontab":"/etc/cron.d/concerto","level":"info","msg":"cronjob added","shell":"/bin/bash","spec":"30 5 * * *","time":"2023-04-07T02:58:32+02:00","user":"nonroot"}
{"command":"/app/bin/concerto-cli logrotate start --env_file /app/.env --verbose \u003e /proc/1/fd/1 2\u003e\u00261","crontab":"/etc/cron.d/concerto","level":"info","msg":"cronjob added","shell":"/bin/bash","spec":"00 0 * * *","time":"2023-04-07T02:58:32+02:00","user":"nonroot"}
{"level":"info","msg":"start runner with 5 jobs\n","time":"2023-04-07T02:58:32+02:00"}
{"level":"info","msg":"got signal: terminated","time":"2023-04-07T03:12:28+02:00"}
{"level":"info","msg":"stop runner","time":"2023-04-07T03:12:28+02:00"}
{"level":"info","msg":"terminated","time":"2023-04-07T03:12:28+02:00"}
[INFO  tini (1)] Spawned child process 'docker-entrypoint' with pid '7'
[DEBUG tini (1)] Passing signal: 'Terminated'
[DEBUG tini (1)] Received SIGCHLD
[DEBUG tini (1)] Reaped child with pid: '7'
[INFO  tini (1)] Main child exited normally (with status '1')

IMHO it should be 0 or 143 : https://komodor.com/learn/exit-codes-in-containers-and-kubernetes-the-complete-guide/

Thank you!

Note : I use exec in docker-entrypoint

nonroot@4e6939d94f43:/app$ ps faux
USER         PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
nonroot     2478  1.0  0.0   4164  3316 pts/0    Ss   03:43   0:00 bash
nonroot     2485  0.0  0.0   6760  2916 pts/0    R+   03:43   0:00  \_ ps faux
nonroot        1  0.0  0.0   2380   568 ?        Ss   02:32   0:00 tini -w -- docker-entrypoint go-crond --allow-unprivileged --include=/etc/cron.d --log.json --server.bind=0.0.0.0:8080
nonroot        7  0.0  0.0 720164 16072 ?        Sl   02:32   0:00 go-crond --allow-unprivileged --include=/etc/cron.d --log.json --server.bind=0.0.0.0:8080
@n-rodriguez
Copy link
Contributor Author

ping @mblaschke

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant