config: add first_start paramter to NMConfig to detect restart

(cherry picked from commit 2131954a19)
This commit is contained in:
Thomas Haller
2017-04-19 15:56:24 +02:00
parent cd92ee58a6
commit 7fa7d57a83
5 changed files with 35 additions and 5 deletions

View File

@@ -149,6 +149,9 @@ nm_main_utils_ensure_rundir ()
exit (1);
}
/* NM_CONFIG_DEVICE_STATE_DIR is used to determine whether NM is restarted or not.
* It is important to set NMConfigCmdLineOptions.first_start before creating
* the directory. */
nm_assert (g_str_has_prefix (NM_CONFIG_DEVICE_STATE_DIR, NMRUNDIR"/"));
if (g_mkdir (NM_CONFIG_DEVICE_STATE_DIR, 0755) != 0) {
errsv = errno;