summaryrefslogtreecommitdiff
path: root/src/nm-config.c
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2014-04-02 12:41:04 -0500
committerDan Williams <dcbw@redhat.com>2014-11-07 12:18:33 -0600
commita01e2ff91d3233526ce359d65be73c098573adfb (patch)
treeec6b2a8589b61b23d6715b9abd2f1e1bf6102761 /src/nm-config.c
parent7df18cba5bfae1ae1ccd87d574dfd2acd9c86e83 (diff)
downloadNetworkManager-a01e2ff91d3233526ce359d65be73c098573adfb.tar.gz
core: add option to quit when startup is complete (rh #863515) (rh #1083683)
Cloud setups often have a never-changing setup and since every cycle counts, they don't really want a management process running in the background after network setup is complete. Since it's likely a VM, it's not like links are going to go up/down very often. Add a new "configure-quit=true/false" config option which, when set to true, will quit NetworkManager after startup and initial configuration is complete.
Diffstat (limited to 'src/nm-config.c')
-rw-r--r--src/nm-config.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/nm-config.c b/src/nm-config.c
index 1f41553355..26d5cb437a 100644
--- a/src/nm-config.c
+++ b/src/nm-config.c
@@ -61,6 +61,8 @@ typedef struct {
char **no_auto_default;
char **ignore_carrier;
+
+ gboolean configure_and_quit;
} NMConfigPrivate;
static NMConfig *singleton = NULL;
@@ -218,6 +220,12 @@ nm_config_get_connectivity_response (NMConfig *config)
return NM_CONFIG_GET_PRIVATE (config)->connectivity_response;
}
+gboolean
+nm_config_get_configure_and_quit (NMConfig *config)
+{
+ return NM_CONFIG_GET_PRIVATE (config)->configure_and_quit;
+}
+
char *
nm_config_get_value (NMConfig *config, const char *group, const char *key, GError **error)
{
@@ -623,6 +631,8 @@ nm_config_new (GError **error)
priv->ignore_carrier = g_key_file_get_string_list (priv->keyfile, "main", "ignore-carrier", NULL, NULL);
+ priv->configure_and_quit = g_key_file_get_boolean (priv->keyfile, "main", "configure-and-quit", NULL);
+
return singleton;
}