Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broker: Wait for interface to have an IP before listening #189

Open
pmelange opened this issue Aug 18, 2023 · 2 comments
Open

Broker: Wait for interface to have an IP before listening #189

pmelange opened this issue Aug 18, 2023 · 2 comments

Comments

@pmelange
Copy link
Contributor

pmelange commented Aug 18, 2023

If the configured port gets it's IP addr per DHCP, then it may not be configured by the time the broker starts.

Here is a log excerpt

Sat Aug 19 12:31:24 2023 daemon.err python[3096]: [WARNING/tunneldigger.broker] Failed to listen on :8943, skipping.

No client connections are possible in this state.

@pmelange
Copy link
Contributor Author

I reworked the init script for OpenWrt to restart tunneldigger-broker when the configured interface goes up. In addition, if the config file gets changed, and reload_config is run on the command line, then the broker also restarts.

I haven't tested this on a distro like Debian. I don't know if tunneldigger-broker starts before the interface gets an ip address. I don't have a way to test it right now. If it's not a problem on Debian, then I would consider this problem "no longer existant" and this issue can be closed.

@RalfJung
Copy link
Member

I never had that problem on our Debian boxes. Our systemd unit file looks as follows

[Unit]
Description = Start tunneldigger L2TPv3 broker
After = network-online.target
Wants = network-online.target

[Service]
ExecStart = /usr/bin/systemd-cat -p notice -t "tunneldigger" /opt/tunneldigger.sh
KillSignal= SIGINT
Restart=on-failure
RestartSec=1

[Install]
WantedBy = multi-user.target

AFAIK the After = network-online.target ensures that the network interface is up before tunneldigger gets started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants