Z-Way on a read-only filesystem
Posted: 15 Sep 2016 18:45
Hello,
I have looked for this issue in the documentation and in the forum but I didn't find anything.
I am building my first Raspberry/Razberry installation, and I've been highly recommended to install the Raspberry on a read-only filesystem - that is, install it normally, then move all the parts of the filesystem that need to be continually written upon to RAM-based temporary filesystems, and mount the main partitions read-only; you can switch them to read-write mode whenever you need to install a new package or edit configurations, but keep the Raspberry normally running in read-only mode. This increases the Raspberry's resilience, as it is highly likely that, if the Raspberry is not shut down cleanly (e.g. due to a power outage), the filesystem on the SD card will become corrupted and you may have to fix it manually or even reinstall it altogether.
My Raspberry works fine in this configuration, except when I try to use the Z-Way server. If I boot the system in read-only mode, the server doesn't start properly; apparently, it has to overwrite some configuration files every time it starts up, even if no configuration was actually changed. If I then remount the filesystem in read-write mode and restart the server, it works fine - however, as soon as the filesystem is changed to read-only mode, the server stops working.
I'm not sure why the Z-Way server needs to write stuff in its own directories all the time (logs are not an issue, as /var/log points to a writable tmpfs). I understand that the server needs to write down whatever configuration change is made through the interface, but as long as you don't edit anything it should be able to work without touching the filesystem; and any temporary stuff should be written to /var and not in the application's own directory.
Anyway, I'd like to know if anyone has ever experimented running Z-Way on a read-only filesystem, whether it worked and how, or whether there is any documentation on which are the specific files and directories that need to be writable; there are some alternatives to reduce the risk of filesystem corruption (for example, moving /opt/z-way-server to a separate read-write partition and keeping all the rest read-only) but I'd prefer to solve the issue cleanly.
Thanks!
I have looked for this issue in the documentation and in the forum but I didn't find anything.
I am building my first Raspberry/Razberry installation, and I've been highly recommended to install the Raspberry on a read-only filesystem - that is, install it normally, then move all the parts of the filesystem that need to be continually written upon to RAM-based temporary filesystems, and mount the main partitions read-only; you can switch them to read-write mode whenever you need to install a new package or edit configurations, but keep the Raspberry normally running in read-only mode. This increases the Raspberry's resilience, as it is highly likely that, if the Raspberry is not shut down cleanly (e.g. due to a power outage), the filesystem on the SD card will become corrupted and you may have to fix it manually or even reinstall it altogether.
My Raspberry works fine in this configuration, except when I try to use the Z-Way server. If I boot the system in read-only mode, the server doesn't start properly; apparently, it has to overwrite some configuration files every time it starts up, even if no configuration was actually changed. If I then remount the filesystem in read-write mode and restart the server, it works fine - however, as soon as the filesystem is changed to read-only mode, the server stops working.
I'm not sure why the Z-Way server needs to write stuff in its own directories all the time (logs are not an issue, as /var/log points to a writable tmpfs). I understand that the server needs to write down whatever configuration change is made through the interface, but as long as you don't edit anything it should be able to work without touching the filesystem; and any temporary stuff should be written to /var and not in the application's own directory.
Anyway, I'd like to know if anyone has ever experimented running Z-Way on a read-only filesystem, whether it worked and how, or whether there is any documentation on which are the specific files and directories that need to be writable; there are some alternatives to reduce the risk of filesystem corruption (for example, moving /opt/z-way-server to a separate read-write partition and keeping all the rest read-only) but I'd prefer to solve the issue cleanly.
Thanks!