-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
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
RFE(nixos): Add generic target for internet accessibility #70960
Comments
It seems there is a
Did you try using it? There's also the |
Yes, |
@flokli no, |
IMO the feature you are missing should be required by Systemd.
|
@doronbehar I don't understand you. So the situation is like this. During startup systemd reaches After laptop sleep-resume, WiFi needs some time (up to 15-20 sec) to actually reconnect to my router, so It may be that |
Well then this is not an issue with Systemd but with your specific network manager. Different networking managers will require different workarounds to make such a systemd target. I once had implemented a script that really monitors my network but for connman. My opinion in this matter, is that this is not a NixOS specific issue, but a general Linux "we never agree on anything" type of issue. NetworkManager sure has an API you should be able to abuse and craft a script that will suit your needs. |
I agree - I don't see this as a NixOS-specific issue. Encouraging a discussion upstream might be a way to go to, but it's hard to do right. How do you define "being online"? Is it the existence of an IPv4 (and IPv6?) default route? What about Captive Portals? Enterprise Networks requiring proxies? What should happen if that state changes during script execution? I'd recommend making your script tolerant to non-available network, and make it retry gracefully (or let it fail, but let systemd take care of retrying). Your script might know best which endpoints it tries to reach, and whether the connection succeeded or not. |
If the consesus is that such a generic systemd target is hard-to-impossible to implement, then I agree, issue should be closed (workarounds may be specified in nixos.wiki page). Maybe let's hear more opinions, and close RFE if noone objects in, say, 6 months?
|
duplicate of #35567 |
I have a laptop, which connects to WiFi-router. The connection takes some time (up to 30s). I also have a service which depends on internet access (backup). On laptop lid-close/open, when backup timer fires during latop sleep, I have backup process started, but it fails immediately because internet is not yet accessible.
Would be great to have a systemd target (like
network-online.target
) that can be used inwants = [ "internet-accessible.target" ];
, to simplify service definition. This target is non-trivial to implement correctly.Or, if this is too specialized, what is a better solution? Keep restarting backup process until succeeded?
The text was updated successfully, but these errors were encountered: