Subject: [alpine-user] Launching udhcpc through wpa_cli actions

From: Gert de Best <[email-masked]>
Date: Mon, 14 Jan 2019 15:38:38 +0000

Hi All,

The wiki says:

With the above configuration, udhcpc will only run once at boot. If the Wifi isn't available then, or the network changes in between, it needs to be notified. This is done through the wpa_cli action script in /etc/wpa_supplicant/wpa_cli.sh

rc-update add wpa_cli boot

But when I do this I get the next error messages when rebooting:

Failed to connect to non-global ctrl_ifname: (nill) error: No such file or directory

  *   Start-stop-deamon: failed to start /sbin/wpa_cli
  *   Failed to start wpa_cli
  *   Error: wpa_cli failed to start

Can anyone point me in the right direction to fix this?

Thanks in advance
Gert.

---

From: Chloe Kudryavtsev <[email-masked]>
Date: Mon, 14 Jan 2019 20:16:58 -0500

> Hi All,

Heya!

> With the above configuration, udhcpc will only run once at boot. If the Wifi isn't available then, or the network changes in between, it needs to be notified. This is done through the wpa_cli actio…

There are currently many issues with wpa_supplicant-related init scripts.

> Failed to connect to non-global ctrl_ifname: (nill) error: No such file or directory

One of them is what wpa_cli and wpa_supplicant actually do not interact, 
and there's no other init script to run.

> Can anyone point me in the right direction to fix this?

You have a couple of options:
1. You can wait until I (or someone else) get(s) around to fixing this, 
and the fix gets merged (though the situation will likely look different 
at that point).
2. You can write your own init scripts (and/or configure the existing 
ones heavily) to provide the mentioned functionality.
3. Use a smarter network manager (not necessarily NetworkManager in 
particular, but any sort of non-constant wireless connection usually 
benefits from one). In this scenario, I'm told connman is highly 
recommended for CLI usage.

The issue with 1 is that that wait may take a long time (for instance, I 
am currently working on getting Alpine's user (and developer) official 
documentation up from 0 to full, which will take a while).

The issue with 2 is you need to thoroughly understand wireless 
networking (e.g copy pasting something someone on the ML writes may 
work, or it may not, and you'll need the knowledge regardless in the 
latter scenario, to understand what went wrong).

The issue with 3 is that the smarter network manager may give you other 
problems.
For instance, as my understanding goes, connman expects that 
wpa_supplicant will be started by itself, but I don't know whether or 
not it provides a specific configuration file, nor how it handled a 
restart of the daemon.

> or the network changes in between
Based on this statement, and the fact that you *connect* to wifi, I'm 
going to assume that your device is not permanently rooted in one spot.

As such I'm going to recommend option 3.

P.S. Technically, wpa_supplicant is currently being replaced by iwd (an 
intel daemon).
We do not currently have a package for it, but adding one is high on my 
todo list (once I finish up with the documentation, which, again, could 
take a while, still).

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---

---

From: PICCORO McKAY Lenz <[email-masked]>
Date: Mon, 14 Jan 2019 11:48:20 -0400

i have also some related problems configuring my wifi.. in my case
passwordless ssid wifi!

at cli when i try to use the device said to me "device busy", network
manager can scan but said "device not ready"

El lun., 14 de ene. de 2019 a la(s) 11:38, Gert de Best ([email-masked])
escribió:

> Hi All,
>
> The wiki says:
>
> With the above configuration, udhcpc will only run once at boot. If the
> Wifi isn't available then, or the network changes in between, it needs to
> be notified. This is done through the wpa_cli action script in
> /etc/wpa_supplicant/wpa_cli.sh
>
>    - Start-stop-deamon: failed to start /sbin/wpa_cli
>    - Failed to start wpa_cli
>    - Error: wpa_cli failed to start
>

---

From: Cosmo Borsky <[email-masked]>
Date: Mon, 14 Jan 2019 13:35:02 -0500

Hi Gert,

Try adding the following to the top of your
`/etc/wpa_supplicant/wpa_supplicant.conf`
```
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel
```

You may also configure `udhcpd_opts` in your `/etc/network/interfaces`
file like so:
`/etc/network/interfaces`
```
# ...
iface wlan0 inet dhcp
    udhcpc_opts -t 0 -T 10 -A 20 -S &
```

The `udhcpc_opts` parameters were taken from the following post:
https://unix.stackexchange.com/a/285930

Piccoro,
As for passwordless wifi, try setting `key_mgmt=NONE` in your
wpa_supplicant network entry.

On 1/14/19 10:48 AM, PICCORO McKAY Lenz wrote:
> El lun., 14 de ene. de 2019 a la(s) 11:38, Gert de Best
> ([email-masked] <mailto:[email-masked]>) escribió:
>
>
>           Hi All,
>
>
>           The wiki says:
>
>     With the above configuration, udhcpc will only run once at boot.
>     If the Wifi isn't available then, or the network changes in
>     between, it needs to be notified. This is done through the wpa_cli
>     action script in /etc/wpa_supplicant/wpa_cli.sh
>