Understood. Although it still seems to me that the code doing more or less what the cron job would do might worth.
On 14.04.21 19:58, Jorge Redondo Flames wrote:
> Stunnel could listen on its local port *only* when the peer server is
> listening on its corresponding server socket. So if there is no serve on
> the other side, there should not be local listening socket. Does not that
> make sense?
No.
In the general situation (server *not* being on the same machine as
stunnel), stunnel CANNOT know whether the server's listening short of
trying to connect to it - which it will only do on behalf of an incoming
client request, which would never happen if stunnel weren't listening.
Even if server and stunnel run on the same machine/OS, finding out about
the server's state would require a bunch of special-purpose code.
Assuming that they *are* on a common Linux (or at least unixoid) system,
however, it would be rather trivial to write a root cron job that checks
the output of "ss"/"netstat" for the server's LISTEN and simply
terminates stunnel if it isn't found.
Or even better, have the server *restarted* automatically whenever it
croaks ...
Regards,
--
Jochen Bern
Systemingenieur
Binect GmbH
_______________________________________________
stunnel-users mailing list -- stunnel-users@stunnel.org
To unsubscribe send an email to stunnel-users-leave@stunnel.org