davesteele / comitup

Bootstrap Wifi support over Wifi
https://davesteele.github.io/comitup/
GNU General Public License v2.0
324 stars 55 forks source link

Running on a read-only filesystem #8

Closed pagaille closed 4 years ago

pagaille commented 6 years ago
$ comitup-cli

State: CONNECTED
Connection: MattLabs
Available commands:
    (i)nfo
    (r)eload
    (d)elete connection
    (q)uit
command?: i
Traceback (most recent call last):
  File "/usr/sbin/comitup-cli", line 11, in <module>
    load_entry_point('comitup==1.2.3', 'console_scripts', 'comitup-cli')()
  File "/usr/share/comitup/cli/comitupcli.py", line 115, in interpreter
    commands[cmd].fn(connection)
  File "/usr/share/comitup/cli/comitupcli.py", line 41, in do_info
    info = ciu.ciu_info(connection)
AttributeError: module 'comitup.client' has no attribute 'ciu_info'
pagaille commented 6 years ago

Scratch that. It looks like comitup doesn't like adafruit's read-only raspberry script, even when starting in read-write mode (using a GPIO jumper) : the DHCP server doesn't work anymore in hotspot mode. I wonder if installing comitup after having launched the read-only script (and having boot in RW mode of course) could solve the issue.

davesteele commented 6 years ago

Bug confirmed. unrelated to the read-only script.

pagaille commented 6 years ago

I guess it has nothing to do with the DHCP server not working correctly ?

davesteele commented 6 years ago

That particular problem? No.

I wouldn't be surprised about problems related to the read-only script. It depends mostly on how it handles /var/log files.

I'd run comitup once before making things read-only. If the /var/lib file is unwritable on the first run, it will crash. If it is transient, the name of the hotspot will change on every boot.

pagaille commented 6 years ago

Txs Dave.

That's what I did. comitup was installed and tested before I ran the script.

There are some comments here and there regarding the DHCP server not being happy on a read-only system. https://www.raspberrypi.org/forums/viewtopic.php?t=62705

davesteele commented 6 years ago

Note that NetworkManager (and therefore Comitup) uses a different service to host DHCP, based on the dnsmasq-base library. It conflicts with the dnsmasq daemon. Based on that library's interface, NetworkManager may or may not try to create a DHCP configuration file on the fly.

davesteele commented 5 years ago

See https://github.com/davesteele/comitup/issues/25#issuecomment-467087333.

davesteele commented 5 years ago

Update, based on the current master.

Comitup and NetworkManager log data. A ram mount of /var/log is recommended.

NetworkManager stores new connection information under /etc, and Comitup creates a /var/lib/comitup file on first run. You would need to establish the desired connections before locking down the file system.

Comitup now manages the dnsmasq-based DNS server. It needs to be able to regularly write in /var/run, and to the /var/lib/comitup directory (DHCP lease information).

There may be more - I haven't actually tried it.