Hi!
On Wed, May 6, 2026 at 3:55 AM <[email protected]> wrote:
>
> Package: erlang-base
> Version: 1:27.3.4.1+dfsg-1+deb13u1
>
> On my system, epmd initially appears to be listening on all interfaces:
>
Usually it is desirable since epmd is a daemon that keeps tracks of Erlang nodes
running on different hosts, they all have to be able to connect to each other's
epmd daemons.
>
> ss -tulpn | grep epmd
> tcp LISTEN 0 4096 *:4369 *:*
> users:(("epmd",pid=2368130,fd=3),("systemd",pid=1,fd=199))
>
>
> I tried to restrict epmd to localhost by creating a systemd socket
> override:
It's reasonable if you don't use distributed Erlang.
>
>
> [Socket]
> ListenStream=127.0.0.1:4369
>
> After that, I ran:
>
> systemctl daemon-reload
> systemctl restart epmd.socket epmd.service
>
>
> At that point, `pmd.socket failed to start with:
>
>
> epmd.socket: Failed to create listening socket (127.0.0.1:4369): Address
> already in use
>
I can reproduce this, as far as I investigated, it is caused by the option
BindIPv6Only=both
in the socket file. When systemd binds to IPv6 address, it also listens to IPv4
packets, which makes address already in use.
To remedy this problem you can do one of the following:
add to your override
BindIPv6Only=ipv6-only
The remaining problem would be listening to [::]:4369 (on all
interfaces using IPv6).
alternatively, remove ListenStream, and add to your override
BindToDevice=lo
This will make systemd/epmd listen on localhost only, which is likely
what you want.
Anyway, I don't think that's a bug in epmd.socket. It works as intended.
Cheers!
--
Sergei Golovan