nmcli command does not work in rc.local

Non release banter
Kulle
Warlord
Warlord
Posts: 594
Joined: 28 Jan 2017, 10:39
Distribution: v4.0 64bit Xfce
Location: Berlin

nmcli command does not work in rc.local

Post#1 by Kulle » 03 Sep 2021, 08:03

I wrote the following command to the rc.local file:

Code: Select all

nmcli dev wifi connect xyz password "abc"
where xyz is the SSID and abc is the password.
However, the command is not executed.
Is it ignored?

But if I change to the /etc/rc.d/ directory and run the rc.local file, the nmcli command works as expected.

Does anyone have an explanation?
What can I do?
Thanks

Kulle
Warlord
Warlord
Posts: 594
Joined: 28 Jan 2017, 10:39
Distribution: v4.0 64bit Xfce
Location: Berlin

nmcli command does not work in rc.local

Post#2 by Kulle » 03 Sep 2021, 12:35

In the meantime, I had an intuitive idea of my own:
I put the command sleep 3 in front of it.
Now it's working.

User avatar
Ed_P
Contributor
Contributor
Posts: 8343
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

nmcli command does not work in rc.local

Post#3 by Ed_P » 03 Sep 2021, 15:51

Kulle wrote:
03 Sep 2021, 12:35
sleep 3 in front of it.
:o An interesting approach.
Ed

User avatar
Blaze
DEV Team
DEV Team
Posts: 3869
Joined: 28 Dec 2010, 11:31
Distribution: ⟰ Porteus current ☯ all DEs ☯
Location: ☭ Russian Federation, Lipetsk region, Dankov
Contact:

nmcli command does not work in rc.local

Post#4 by Blaze » 03 Sep 2021, 18:51

sleep 5 && your-command-is-here
Linux 6.6.11-porteus #1 SMP PREEMPT_DYNAMIC Sun Jan 14 12:07:37 MSK 2024 x86_64 Intel(R) Xeon(R) CPU E3-1270 v6 @ 3.80GHz GenuineIntel GNU/Linux
MS-7A12 » [AMD/ATI] Navi 23 [Radeon RX 6600] [1002:73ff] (rev c7) » Vengeance LPX 16GB DDR4 K2 3200MHz C16

Post Reply