mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-25 00:10:07 +01:00
main: ensure NMSTATEDIR exists (bgo #689744)
For OSTree/gnome-ostree, the model chosen for /var is that services are responsible for creating any data they need in /var at runtime. Call g_mkdir_with_parents() to ensure NMSTATEDIR exists. https://bugzilla.gnome.org/show_bug.cgi?id=689744 Based on Colin Walters' patch.
This commit is contained in:
parent
76e8f60212
commit
e7add58aad
1 changed files with 6 additions and 0 deletions
|
|
@ -435,6 +435,12 @@ main (int argc, char *argv[])
|
|||
exit (1);
|
||||
}
|
||||
|
||||
/* Ensure state directory exists */
|
||||
if (g_mkdir_with_parents (NMSTATEDIR, 0755) != 0) {
|
||||
nm_log_err (LOGD_CORE, "Cannot create '%s': %s", NMSTATEDIR, strerror (errno));
|
||||
exit (1);
|
||||
}
|
||||
|
||||
pidfile = pidfile ? pidfile : g_strdup (NM_DEFAULT_PID_FILE);
|
||||
state_file = state_file ? state_file : g_strdup (NM_DEFAULT_SYSTEM_STATE_FILE);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue