mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-06-14 22:48:26 +02:00
core: support "/run/NetworkManager/proc-cmdline" to overwrite /proc/cmdline
We read /proc/cmdline for "match.kernel-command-line". But next we will also honor "nm.debug" on the kernel command line, to enable debug logging. For "nm.debug" it makes sense that it overwrites the debug options from the command line and from "NetworkManager.conf". That means, if you set "nm.debug", then verbose logging will be enabled. It can only be turned off again at runtime (via D-Bus), otherwise, it's hard to avoid. It still can make sense to overrule this setting once again. Support that, by honoring a file "/run/NetworkManager/proc-cmdline" to be used instead of "/proc/cmdline". This option is mainly for debugging and testing, but it might be useful in production too, if you had "nm.debug" enabled during boot, but later want to disable it until next reboot. Then you could do: sed 's/ *\<nm\.debug\> */ /g' /proc/cmdline > /run/NetworkManager/proc-cmdline nmcli general logging level DEFAULT domains DEFAULT
This commit is contained in:
parent
4dd4d5b759
commit
d4b7934997
1 changed files with 4 additions and 1 deletions
|
|
@ -3090,7 +3090,10 @@ again:
|
|||
if (G_UNLIKELY(!proc_cmdline)) {
|
||||
gs_free char *str = NULL;
|
||||
|
||||
g_file_get_contents("/proc/cmdline", &str, NULL, NULL);
|
||||
/* /run/NetworkManager/proc-cmdline can be used to overrule /proc/cmdline. */
|
||||
if (!g_file_get_contents(NMRUNDIR "/proc-cmdline", &str, NULL, NULL))
|
||||
g_file_get_contents("/proc/cmdline", &str, NULL, NULL);
|
||||
|
||||
str = nm_str_realloc(str);
|
||||
|
||||
proc_cmdline = str ?: "";
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue