all-interfaces event
many services depend on other services that bring up network interfaces. Examples are ipv6 tunneling clients or VPNs. As there are multiple choices for these network-interface-providing services, it's not nice to hardcore these deps in every service. This change sets up a generic config option for this purpose. providers (gw6c/gogoclient/openvpn) can plug into this to signal they bring up an important interface. Daemons that need these interfaces, can then depend on the 'all-interfaces' event, instead of the individual services. By default, the event fires when network-interfaces completes. svn path=/nixos/trunk/; revision=32764
This commit is contained in:
parent
6240825e27
commit
77240b46f1
|
@ -173,6 +173,16 @@ in
|
|||
'';
|
||||
};
|
||||
|
||||
networking.interfaceJobs = mkOption {
|
||||
default = [config.jobs.networkInterfaces];
|
||||
type = types.list types.attrs;
|
||||
merge = mergeListOption;
|
||||
description = ''
|
||||
List of jobs that bring up additional interfaces.
|
||||
For example vpn / ipv6 / ppp tasks.
|
||||
This gets used by certain services as dependency for their upstart job.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
|
@ -273,6 +283,19 @@ in
|
|||
'';
|
||||
};
|
||||
|
||||
jobs.allInterfaces = {
|
||||
name = "all-interfaces";
|
||||
description = "all required interfaces are up";
|
||||
startOn = concatStringsSep " and " (map (job: "started ${job.name}") cfg.interfaceJobs);
|
||||
stopOn = concatStringsSep " and " (map (job: "stopping ${job.name}") cfg.interfaceJobs);
|
||||
task = true;
|
||||
exec = "true";
|
||||
};
|
||||
|
||||
|
||||
networking.interfaceJobs = [config.jobs.networkInterfaces];
|
||||
|
||||
|
||||
# Set the host name in the activation script. Don't clear it if
|
||||
# it's not configured in the NixOS configuration, since it may
|
||||
# have been set by dhclient in the meantime.
|
||||
|
|
Loading…
Reference in a new issue