Convert all systemd-networkd service restarts to reloads
This removes all of the current invocations of managed service
restarting, and instead opts for targeted reloading of
configuration files.
It also happens to fix some bugs around NIC enabled setting, as the
systemd-networkd service now has up to date runtime configurations at
the time that objects are refreshed.
Change-Id: I64cd4f3fcd66eb2ad23b973eb86a71606e528e37
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/src/system_configuration.cpp b/src/system_configuration.cpp
index 6c30da2..c37cfc6 100644
--- a/src/system_configuration.cpp
+++ b/src/system_configuration.cpp
@@ -122,7 +122,10 @@
InvalidArgumentMetadata::ARGUMENT_VALUE(gateway.c_str()));
}
gw = SystemConfigIntf::defaultGateway(gateway);
+
manager.writeToConfigurationFile();
+ manager.reloadConfigs();
+
return gw;
}
@@ -143,7 +146,10 @@
InvalidArgumentMetadata::ARGUMENT_VALUE(gateway.c_str()));
}
gw = SystemConfigIntf::defaultGateway6(gateway);
+
manager.writeToConfigurationFile();
+ manager.reloadConfigs();
+
return gw;
}