a16bitsysop / docker-olefy

Alpine based docker image to run olefy.
GNU General Public License v3.0
2 stars 0 forks source link

health-nc.sh PING 10050 PONG not working #15

Closed kingfisher77 closed 2 years ago

kingfisher77 commented 2 years ago

Hi, the implemented health-nc.sh is not working like expected:

root@mail2:/opt/mailserver/olefy # dc exec olefy sh
/usr/local/bin # health-nc.sh PING 10050 PONG
/usr/local/bin #

No PONG :-) Container is unhealthy.

olefy.py seems to be there:

/usr/local/bin # netstat -tulpen
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:10055           0.0.0.0:*               LISTEN      -
tcp        0      0 127.0.0.11:34281        0.0.0.0:*               LISTEN      -
udp        0      0 127.0.0.11:49510        0.0.0.0:*                           -

Any idea?

a16bitsysop commented 2 years ago

Which image are you using?

I use it via docker compose and I get container healthy with a docker ps

a16bitsysop commented 2 years ago

I checked and it is because the PONG is not echoed, it is the result code that is used by docker healthcheck. If you do an echo $? after you get zero which is a successful exit

if the command is changed to health-nc.sh PING 10050 PONGY and echo $? is one as PONGY is not reurned

kingfisher77 commented 2 years ago

I use a16bitsysop/olefy:latest And yes, it is the result code. I changed it and the healthcheck is working now. Thank you!