Hi, On 12/09/12 11:12, Mathijs Kwik wrote:
> Currently (with upstart), network interfaces tigger ip-up once dhcpcd > assigns them an ip-address. > Upstart triggers had an option to supply extra params, and dhcpcd's > hook used this to supply information on which interface got connected, > and - if on wireless - to which AP a connection was made. > > I have a somewhat complicated networking setup, so I use these features a lot. > Depending on which wifi AP (trusted/untrusted), I enable different > firewall rules, openvpn tunnels and routes. > > Now, I think I should just define systemd targets for these > environments (trusted/untrusted/home) and add the services I want to > these. > However, I need a way to tell upstart which of these targets to (de)activate. > Currently, "ip-up" is hardcoded in dhcpcd's hook, "ip-down" is > disabled (used to trigger when disconnecting wifi), and if multiple > interfaces come up, nothing will happen if the ip-up target was > already reached. Systemd units have a template instantiation mechanism which might be useful here. We can have units "[email protected]" and "[email protected]" that get instantiated when a specific interface goes up or down. So if wlan0 appears, we can instantiate "[email protected]", which in turn can pull in other dependencies. -- Eelco Dolstra | LogicBlox, Inc. | http://nixos.org/~eelco/ _______________________________________________ nix-dev mailing list [email protected] http://lists.science.uu.nl/mailman/listinfo/nix-dev
