Don't include networkd units unless enabled

Otherwise, the enabled -> disabled transition won't be handled
correctly (switch-to-configuration currently assumes that if a unit is
running and exists, it should be restarted).
This commit is contained in:
Eelco Dolstra 2015-04-19 21:11:14 +02:00
parent f8dbe5f376
commit c87977e97d
4 changed files with 7 additions and 6 deletions

View file

@ -624,6 +624,9 @@ in
config = mkIf config.systemd.network.enable {
systemd.additionalUpstreamSystemUnits =
[ "systemd-networkd.service" "systemd-networkd-wait-online.service" ];
systemd.network.units =
mapAttrs' (n: v: nameValuePair "${n}.link" (linkToUnit n v)) cfg.links
// mapAttrs' (n: v: nameValuePair "${n}.netdev" (netdevToUnit n v)) cfg.netdevs

View file

@ -18,6 +18,8 @@ with lib;
config = mkIf config.services.resolved.enable {
systemd.additionalUpstreamSystemUnits = [ "systemd-resolved.service" ];
systemd.services.systemd-resolved = {
wantedBy = [ "multi-user.target" ];
restartTriggers = [ config.environment.etc."systemd/resolved.conf".source ];

View file

@ -97,12 +97,6 @@ let
"systemd-modules-load.service"
"kmod-static-nodes.service"
# Networking
"systemd-networkd.service"
"systemd-networkd-wait-online.service"
"systemd-resolved.service"
"systemd-timesyncd.service"
# Filesystems.
"systemd-fsck@.service"
"systemd-fsck-root.service"

View file

@ -18,6 +18,8 @@ with lib;
config = mkIf config.services.timesyncd.enable {
systemd.additionalUpstreamSystemUnits = [ "systemd-timesyncd.service" ];
systemd.services.systemd-timesyncd = {
wantedBy = [ "sysinit.target" ];
restartTriggers = [ config.environment.etc."systemd/timesyncd.conf".source ];