karaf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Laurent (JIRA)" <j...@apache.org>
Subject [jira] [Created] (KARAF-5386) /var/lib files are touched and fill up ramdisk although they are not modified
Date Fri, 22 Sep 2017 15:23:01 GMT
Laurent created KARAF-5386:
------------------------------

             Summary: /var/lib files are touched and fill up ramdisk although they are not
modified
                 Key: KARAF-5386
                 URL: https://issues.apache.org/jira/browse/KARAF-5386
             Project: Karaf
          Issue Type: Bug
    Affects Versions: 4.0.8
         Environment: *OpenHab2 / Debian Jessie 8 (Armbian) with overlayfs (see context below)*
I run OpenHab2 (a Karaf based project) on a development box under Debian 8 (Armbian Jessie)
and I set an [`overlayfs`](https://www.datalight.com/blog/2016/01/27/explaining-overlayfs-%E2%80%93-what-it-does-and-how-it-works/).
This makes the mass storage device to be safe (mounted as read-only), even with power breakage.

This overlay FS is schematically a RamDisk that receives all write operations and store them
while the permanent storage is read as an underlayer. Writing on the overlay FS effectively
writes in the ramdisk, not in the permanent storage device.

If electric power is lost, all changes in RamDisk are lost, but the permanent storage is not
altered.

Any file that is [`touch`ed](https://en.wikipedia.org/wiki/Touch_(Unix)) is copied (duplicated)
from the underlying permanent storage to the RamDisk. So it occupies some RAM even if its
content did not change
            Reporter: Laurent


h2. Expected Behavior

When running `openhab2` only some files should be modified and the footprint in RamDisk should
be kept low. Installed addons files (JAR and other) should not be modified since they are
not updated or re-installed.

h2. Current Behavior

At startup or after startup, `openhab2` `touch`es (in the UNIX way of the term) several jar
files [(see link with list of addons' touched files)](https://gist.github.com/lauhub/09db500a12543d6c7f7dd49eb9d2751c)
and fills up the RamDisk with about 141MB of unuseful data

By unuseful I mean that these files are not modified: md5 sum of both RamDisk and permanent
storage are identical (for all files in /var/lib)

Current ramdisk is 512MB, which leads to some crash if it is filled up. I am limited to this
size (total amount of RAM : 1GB) and this *cannot* be changed since the box cannot have more
RAM 

h2. Possible Solution

 - Do not make the `touch` operation on the file when it already exists
 - Setup the `/var/lib/openhab2/kar/openhab-addons-2.1.0` as read-only (but this may lead
to bug when installing or updating addons)

About the last workaround: what are the possible consequences of doing this wrt Karaf good
functioning ?

h2. Steps to Reproduce (for Bugs)

1. Create a read-only system with an overlayroot (under Ubuntu using the overlayroot package).
2. Install openhab2
3. use `df -h` to show ramdisk usage

h2. Environment

* OpenHab Version used: 2.1.0
* Addons list: see [this gist](https://gist.github.com/lauhub/09db500a12543d6c7f7dd49eb9d2751c)
* Environment name and version : java version "1.8.0_131"
* Operating System and version: Armbian Jessie




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message