Skip to content

Exit status #393

Closed
Closed
@n-rodriguez

Description

@n-rodriguez

When the container/nginx_exporter is stopped the exit status is 1 :

-----> Checking services presence
-----> Nginx is unavailable - sleeping
-----> Nginx is unavailable - sleeping
-----> Nginx is unavailable - sleeping
-----> Nginx is unavailable - sleeping
-----> Nginx is unavailable - sleeping
-----> Nginx is unavailable - sleeping
-----> Nginx is unavailable - sleeping
-----> Nginx is unavailable - sleeping
-----> Nginx is unavailable - sleeping
-----> Nginx is unavailable - sleeping
-----> Nginx is unavailable - sleeping
-----> Nginx is unavailable - sleeping
-----> Nginx is unavailable - sleeping
-----> Nginx is unavailable - sleeping
=====> Nginx is up
=====> Executing command: nginx_exporter
NGINX Prometheus Exporter version=0.11.0 commit=e4a6810d4f0b776f7fde37fea1d84e4c7284b72a date=2022-09-07T21:09:51Z, dirty=false, arch=linux/arm64, go=go1.19
2023/04/07 02:58:49 Starting...
2023/04/07 02:58:49 Listening on :9113
2023/04/07 02:58:49 NGINX Prometheus Exporter has successfully started
2023/04/07 03:12:29 Signal received: terminated. Exiting...
2023/04/07 03:12:29 http: Server closed
[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@a4edf2bc1f5c:/app$ ps faux
USER         PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
nonroot     2699  1.0  0.0   4164  3284 pts/0    Ss   03:41   0:00 bash
nonroot     2706  0.0  0.0   6760  2856 pts/0    R+   03:41   0:00  \_ ps faux
nonroot        1  0.0  0.0   2380   572 ?        Ss   02:33   0:00 tini -w -- docker-entrypoint nginx_exporter
nonroot        7  0.0  0.0 722376 21980 ?        Sl   02:33   0:01 nginx_exporter -nginx.scrape-uri=http://nginx:9090/nginx-status

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions