Hello,
As a confirmation, I tried to verify if starting
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:In another terminal, while the NetworkManager was running with gdb attached, I ran the
Then I tried theIn the end, if you wish, you can work around it using as alias that mixes the two commands; i.e.Then, you can simply use the aliased command: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.
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:
- downloaded the NetworkManager source code and debugging symbols
- started the gdb (GNU debugger) and attached it to the running NetworkManager daemon
- instructed the debugger where to find the NetworkManager source code (-d option)
- set a breakpoint on the function and added a date/time marker command
- let the NetworkManager run until the breakpoint is hit
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) continuenmtui-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) Code:
alias nm_tui="nmcli device wifi; nmtui-connect"Code:
nm_tuiThe 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