ZRAM nightly sync, openhab service restart

Hi all,
I’v changed the time setting in the .timer just to be sure that is wasn’t the Amanda backup causing the freeze of both log files.
below are the last lines of syslog before it freezes, next morning i wake it up by HUP’ing it.

May 14 02:05:01 domoberry CRON[13933]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1)
May 14 02:05:01 domoberry systemd[1]: Starting Perform nightly zram sync to persistent storage...
May 14 02:05:01 domoberry zram-sync[13943]: zram-config sync 2024-05-14-02:05:01-CEST
May 14 02:05:01 domoberry systemd[6276]: var-log.mount: Succeeded.
May 14 02:05:01 domoberry systemd[1]: var-log.mount: Succeeded.

To check the openhab logging i’ve made a test rule writing a logInfo line ever minute from 2:00
Below are the last line’s before if freezes

2024-05-14 02:00:01.125 [INFO ] [org.openhab.core.model.script.test  ] - de tijd is nu 2024-05-14T02:00:01.123678815+02:00[Europe/Berlin]
2024-05-14 02:01:00.851 [INFO ] [org.openhab.core.model.script.test  ] - de tijd is nu 2024-05-14T02:01:00.850710519+02:00[Europe/Berlin]
2024-05-14 02:02:00.852 [INFO ] [org.openhab.core.model.script.test  ] - de tijd is nu 2024-05-14T02:02:00.851513460+02:00[Europe/Berlin]
2024-05-14 02:03:00.851 [INFO ] [org.openhab.core.model.script.test  ] - de tijd is nu 2024-05-14T02:03:00.850359501+02:00[Europe/Berlin]
2024-05-14 02:04:00.851 [INFO ] [org.openhab.core.model.script.test  ] - de tijd is nu 2024-05-14T02:04:00.850190971+02:00[Europe/Berlin]
2024-05-14 02:05:00.850 [INFO ] [org.openhab.core.model.script.test  ] - de tijd is nu 2024-05-14T02:05:00.849583835+02:00[Europe/Berlin]

And yes indeed events.log continues to be writen as expected.

Hi there,
Tried @rlkoshak idea to change my /var/lib/openhab/etc/log4j2.xml file.
edited line 9 - 20 to this:

                <!-- Rolling file appender Zram bug change to RollingRandomAccessFile-->
                <!--<RollingFile -->
                <RollingRandomAccessFile fileName="${sys:openhab.logdir}/openhab.log" filePattern="${sys:openhab.logdir}/openhab.log.%i.gz" name="LOGFILE">
                        <PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} [%-5.5p] [%-36.36c] - %m%n"/>
                        <Policies>
                                <OnStartupTriggeringPolicy/>
                                <SizeBasedTriggeringPolicy size="16 MB"/>
                        </Policies>
                        <DefaultRolloverStrategy max="7"/>
                </RollingRandomAccessFile>
                <!--</RollingFile> -->

The /var/log/openhab/openhab.log file now survived multiple zsync cylci.

So i might say that this workaround is the solution tot me.
I don’t know if there are negative side effects to this change, if I do encounter any I’ll report back.

The (r)syslog is less important as the new installs thrust completely on journal, which isn’t affected by this bug.

p.s. also found that the latest openhabian setup sync’s zram every hour, which make’s it even more annoying is the logging stops.

Sorry to inform every body that the above didn’t solve the issue as i was thinking /hoping /looked like it.
i’m now on Version: 4.1.3 (Build) but openhab.log stalls daliy around 5 AM again.
i’ll do see these warnings every day around the time openhab.log stops:

journalctl|grep 05:07

jul 08 05:07:14 domoberry systemd[1]: Starting zsync.service - Perform nightly zram sync to persistent storage...
jul 08 05:07:14 domoberry zram-sync[27319]: zram-config sync 2024-07-08-05:07:14-CEST
jul 08 05:07:14 domoberry systemd[1]: var-log.mount: Deactivated successfully.
jul 08 05:07:14 domoberry frontail[6000]: tail: '/var/log/openhab/openhab.log' is vervangen;  het nieuwe bestand wordt gevolgd
jul 08 05:07:16 domoberry kernel: overlayfs: workdir is in-use as upperdir/workdir of another mount, accessing files from both mounts will result in undefined behavior.
jul 08 05:07:16 domoberry systemd[1]: srv-openhab\x2duserdata-persistence.mount: Deactivated successfully.
jul 08 05:07:16 domoberry systemd[1]: var-lib-openhab-persistence.mount: Deactivated successfully.
jul 08 05:07:18 domoberry frontail[6000]: tail: '/var/log/openhab/openhab.log' is vervangen;  het nieuwe bestand wordt gevolgd
jul 08 05:07:42 domoberry systemd[1]: zsync.service: Deactivated successfully.
jul 08 05:07:42 domoberry systemd[1]: Finished zsync.service - Perform nightly zram sync to persistent storage.
jul 08 05:07:42 domoberry systemd[1]: zsync.service: Consumed 10.216s CPU time.

So Frontail detects a rotation of openhab.log.
But there is a warning of kernel: overlayfs: which may be intresting to those who understand what is happening.

Just FYI, the issue completely disappeared for me after I did a fresh flash and install of the lastest openhabian release v1.9c. :man_shrugging:t2:

I don’t know if it makes a difference, but I also changed back from 64bit to 32bit on my raspberry pi 3b.