[systemd-devel] Handling on network-connections and networkmanager
Andrei Borzenkov
arvidjaar at gmail.com
Sun Jun 18 05:44:50 UTC 2017
18.06.2017 02:47, Jakob Schürz пишет:
...
>
> i created a simple script, which checks the connection every minute. Is
> there a connection, and is this connection working (realized with a ping
> to a server in the internet), then network-online.target gets (re)started.
> If there is no connection, or the connection is not working (think about
> WLAN in a train in a tunnel, WLAN is working, but no connection to the
> internet is possible), network-online.target gets stopped.
>
> Also a simple script in NetworkManager/dispatcher.d/, wich starts
> network-online.target, when a connection changes its state zu up, and
> stop this target, when a connection changes to down.
>
> All services, which should stop on closing the network-connection have
> the dependency BindsTo=network-online.target
>
> But i'm not sure, if this is a good solution to change the behaviour of
> network-online.target. Should i create a own target? Or is there
> another, better solution?
>
systemd is not designed to track network state, nor is
network-online.target meaningful outside of initial boot transaction. So
yes, it would be more clean to use custom target to avoid confusion.
More information about the systemd-devel
mailing list