/etc/hostapd.wifi_psk cleared after ASU

I have used WPA3 PPSK to protect my network and allow isolating traffic from different devices. However, /etc/hostapd.wifi_psk is truncated to 0 bytes after attended sysupgrade, causing devices to be unable to connect.

Is it possible to set this configuration via UCI instead? If not, can I place this file in some place it will not be erased?

Try adding the file location to /etc/sysupgrade.conf

3 Likes

Thank you! Why is the file truncated to 0 bytes instead of being deleted? This is quite surprising.

In the backup archives where you didn’t specify in sysupgrade.conf, correct?

Or after adding it?

After the ASU, stat /etc/hostapd.wifi_psk reveals that it is empty. I haven’t done a sysupgrade since adding that file to /etc/sysupgrade.conf.

1 Like

Likely the file was deleted, but then a process recreated the file (empty, but present).

By specifying it in the /etc/config/sysupgrade.conf file, it will be backed up and restored/kept as expected.

2 Likes

Does it exist as a 0b file on your system?

But interesting why if so.

If it's not backed up, the file is simply not kept across the upgrade. Technically, what happens is that the keep settings relies on the sysupgrade.conf file contents. Things are backed up, the router is flashed, and then the backups are restored (all handled by asu/sysupgrade). So here, the file wasn't specified so it was deleted.

But as for the recreation -- it would seem that the hostapd process noticed that the file was missing and created it so that it wouldn't error out (this is educated speculation, I haven't reviewed the code to verify that this is correct). As such, it would touch the file resulting in an empty but existent file.

2 Likes

I misunderstood which process you were referencing at first, lol, indeed.

That makes sense. I suspect it was recreated by hostapd or UCI.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.