sane way of cleaning up stale unix sockets?

Александр Поволоцкий tarkhil at over.ru
Tue Dec 22 14:14:15 UTC 2020


Maybe just https://gavv.github.io/articles/unix-socket-reuse/ ?

On 22.12.2020 17:12, Valentin V. Bartenev wrote:
> On Saturday, 19 December 2020 18:48:02 MSK Александр Поволоцкий wrote:
>> Hello
>>
>> Sometimes unitd leaves behind orphaned unix sockets (well, just
>> configure it to use some and kill -9!)
>>
>> On next start, unitd fails to start because of existing sockets.
>>
>> Is there a sane way to clean up them on start? keeping separate list of
>> sockets-to-remove is a clear way to insainty.
> [..]
>
> Hello,
>
> Indeed, this is a problem.  That's the reason why the usage of unix sockets
> in listeners is still undocumented.
>
> It's not so easy to fix, because we need to avoid the situation when the socket
> is used by some other processes and avoid any possible race conditions
> here.
>
> Actually, until it will be fixed I have no better idea than put them all in the
> same dedicated directory and just clean up everything in it each restart.
>
>    wbr, Valentin V. Bartenev
>
>
>
> _______________________________________________
> unit mailing list
> unit at nginx.org
> https://mailman.nginx.org/mailman/listinfo/unit


More information about the unit mailing list