Quantcast
Channel: Debian User Forums
Viewing all articles
Browse latest Browse all 2849

System and Network configuration • Re: Network does not show without "nmcli dev wifi" first

$
0
0
Hello,

As a confirmation, I tried to verify if starting nmtui-connect would trigger a WiFi network rescan in the NetworkManager running daemon (before the character-based user interface with the list of available connections is displayed).

To do this, I used gdb (GNU Debugger) to activate a breakpoint in the NetworkManager function (called nm_device_recheck_available_connections) that is executed when a rescan is done.

In a terminal:
  1. downloaded the NetworkManager source code and debugging symbols
  2. started the gdb (GNU debugger) and attached it to the running NetworkManager daemon
  3. instructed the debugger where to find the NetworkManager source code (-d option)
  4. set a breakpoint on the function and added a date/time marker command
  5. let the NetworkManager run until the breakpoint is hit
These are the commands:

Code:

# trace the NetworkManager for connections rescan#$ apt source network-manager$ su -l -c "apt install network-manager-dbgsym"$ cd network-manager-1.42.4$ su -l -c "gdb --pid $(pgrep NetworkManager) -d $PWD"(gdb) break nm_device_recheck_available_connections(gdb) continue
In another terminal, while the NetworkManager was running with gdb attached, I ran the nmtui-connect command: it did not cause the breakpoint to be hit.

Then I tried the nmcli device wifi command: the breakpoint at nm_device_recheck_available_connections was hit:

Code:

Thread 1 "NetworkManager" hit Breakpoint 1, nm_device_recheck_available_connections (self=self@entry=0x55f76dedc810) at src/core/devices/nm-device.c:1510315103   {(gdb) 
In the end, if you wish, you can work around it using as alias that mixes the two commands; i.e.

Code:

alias nm_tui="nmcli device wifi; nmtui-connect"
Then, you can simply use the aliased command:

Code:

nm_tui
Of course, the rescan will take some time to complete, so nmtui-connect will start a little later.

The alias can be added at the end of the ~/.bashrc file of the user's home directory.

Hope this helps. Please let me know.

Statistics: Posted by Aki — 2024-07-13 15:44



Viewing all articles
Browse latest Browse all 2849

Trending Articles