[systemd-devel] multiple starts for a socket-based service
Ross Boylan
rossboylan at stanfordalumni.org
Fri Aug 4 22:11:11 UTC 2023
Well, the problem is not completely solved. The socket is not
starting when the system comes up (tried it twice):
Aug 04 11:33:16 barley systemd[1757]: family.socket: Failed to create
listening socket (192.168.1.10:14987): Cannot assign requested address
Aug 04 11:33:16 barley systemd[1]: family.socket: Failed to receive
listening socket (192.168.1.10:14987): Input/output error
Aug 04 11:33:16 barley systemd[1]: family.socket: Failed to listen on
sockets: Input/output error
Aug 04 11:33:16 barley systemd[1]: family.socket: Failed with result
'resources'.
Aug 04 11:33:16 barley systemd[1]: Failed to listen on Socket to
tickle to update family netboot config.
I can manually start the socket after the system is up.
What is the problem and how can I fix it?
The full startup logs suggest (based on the sequence of lines in the
log) systemd attempts to bring up the socket immediately after the br0
device (a bridge) is created, which happens very early in the startup,
about 2s after restart. But I don't think there are any IP address
assignments until the Debian networking stuff does ifup, which happens
around 82s after restart.
Theory: since br0 has no associated IP address when socket creation is
attempted, the socket creation fails. If so, I need to delay socket
startup until br0 has an IP4 address, but I'm not sure how to do
that--or even if that is the problem.
Is WantedBy=network-online.target appropriate?
Substantively, there is no rush to create the socket.
Another curiosity is the there are 2 devices listed for the bridge:
root at barley:~# systemctl list-units '*br0*'
UNIT LOAD ACTIVE SUB DESCRIPTION
sys-devices-virtual-net-br0.device loaded active plugged
/sys/devices/virtual/net/br0
sys-subsystem-net-devices-br0.device loaded active plugged
/sys/subsystem/net/devices/br0
Suggestions?
Ross
On Thu, Aug 3, 2023 at 11:04 PM Ross Boylan
<rossboylan at stanfordalumni.org> wrote:
> Here's the current configuration:
> # /etc/systemd/system/family.socket
> [Unit]
> Description=Socket to tickle to update family netboot config
>
> [Install]
> WantedBy=network-online.target
>
> [Socket]
> ListenStream=192.168.1.10:14987
> # want to run a new job, aka service, for each connection.
> Accept=Yes
> BindToDevice=br0
> # 2s is default
> TriggerLimitIntervalSec=5s
>
More information about the systemd-devel
mailing list