-
Platform information:
-
Hardware: Raspberry PI5
-
OS: openhabian
-
Java Runtime Environment: which java platform is used and what version
-
openHAB version: 5.0.2
-
-
Issue of the topic:
- openhab service restart every 2 hours since Modbus things is running
- before starting the polling I had no restart of the service
- The logging doesn’t anything special or systematic just the information that the openhab restart
2025-11-07 12:08:40.217 [INFO ] [org.openhab.core.Activator ] - Starting openHAB 5.0.2 (Release Build) 2025-11-07 14:02:28.835 [INFO ] [org.openhab.core.Activator ] - Starting openHAB 5.0.2 (Release Build) 2025-11-07 16:09:08.831 [INFO ] [org.openhab.core.Activator ] - Starting openHAB 5.0.2 (Release Build) 2025-11-07 18:02:41.053 [INFO ] [org.openhab.core.Activator ] - Starting openHAB 5.0.2 (Release Build) 2025-11-07 20:08:46.729 [INFO ] [org.openhab.core.Activator ] - Starting openHAB 5.0.2 (Release Build) 2025-11-07 22:10:18.387 [INFO ] [org.openhab.core.Activator ] - Starting openHAB 5.0.2 (Release Build) -
Please post configurations (if applicable):
-
Things configuration:
UID: modbus:poller:ModbusPolling label: ABBWallboxPolling thingTypeUID: modbus:poller configuration: length: 36 start: 16384 refresh: 60000 maxTries: 3 cacheMillis: 50 type: holding bridgeUID: modbus:tcp:ABBWallbox location: Outside
UID: modbus:tcp:ABBWallbox label: ABBWallbox thingTypeUID: modbus:tcp configuration: rtuEncoded: false connectMaxTries: 1 reconnectAfterMillis: 0 timeBetweenTransactionsMillis: 60 port: 502 timeBetweenReconnectMillis: 0 connectTimeoutMillis: 10000 host: 192.168.1.100 afterConnectionDelayMillis: 0 id: 1 enableDiscovery: false location: Outside -
If you don’t see logging showing that OH is shutting down before restarting that means either OH is crashing or something is killing it.
Do you see anything in the syslog or journalctl? If OH is crashing or being killed that’s where that will be logged. OH wouldn’t have a chance to log anything to its own log if it’s killed.
Note, if you are running out of RAM and SWAP, Linux will just start killing processes usually starting with the process using the larges amount of RAM. I wouldn’t expect that on an RPi 5 but it’s something to look at.
Checked in journalctl.
Every two hours there is the SD rsync service running. At the end openhab is topped
At 20:08:09 it seems to run correctly but still at the end openhab is restarted (2nd part of the code)
Nov 07 20:08:09 openhabian5 systemd[1]: Starting sdrsync.service - Run SD rsync daily except semiannually (when a raw dump is made)...
Nov 07 20:08:10 openhabian5 grafana[283039]: logger=server t=2025-11-07T20:08:10.04210108+01:00 level=info msg="Shutdown started" reason="System signal: terminated"
Nov 07 20:08:39 openhabian5 systemd[1]: storage-syncmount.mount: Deactivated successfully.
Nov 07 20:08:39 openhabian5 kernel: EXT4-fs (sda2): unmounting filesystem 22087cd5-bec2-488a-bcd0-ac66ba47003c.
Nov 07 20:08:39 openhabian5 systemd[1]: sdrsync.service: Deactivated successfully.
Nov 07 20:08:39 openhabian5 systemd[1]: Finished sdrsync.service - Run SD rsync daily except semiannually (when a raw dump is made).
Nov 07 20:08:39 openhabian5 systemd[1]: sdrsync.service: Consumed 3.191s CPU time.
Nov 07 20:08:39 openhabian5 systemd[1]: openhab.service: Deactivated successfully.
Nov 07 20:08:39 openhabian5 systemd[1]: Stopped openhab.service - openHAB - empowering the smart home.
Nov 07 20:08:39 openhabian5 systemd[1]: openhab.service: Consumed 4min 19.361s CPU time.
Nov 07 20:08:39 openhabian5 systemd[1]: systemd-journald.socket: Deactivated successfully.
Nov 07 20:08:39 openhabian5 systemd[1]: Closed systemd-journald.socket - Journal Socket.
Nov 07 20:08:39 openhabian5 systemd[1]: Stopping systemd-journald.socket - Journal Socket...
Nov 07 20:08:39 openhabian5 systemd[1]: Listening on systemd-journald.socket - Journal Socket.
Nov 07 20:08:39 openhabian5 systemd[1]: Starting influxdb.service - InfluxDB is an open-source, distributed, time series database...
Nov 07 20:08:39 openhabian5 systemd[1]: Starting nmbd.service - Samba NMB Daemon...
Nov 07 20:08:39 openhabian5 systemd[1]: Starting openhab.service - openHAB - empowering the smart home...
Nov 07 20:08:39 openhabian5 systemd[1]: Starting systemd-journald.service - Journal Service...
Nov 07 20:08:39 openhabian5 systemd[1]: Started openhab.service - openHAB - empowering the smart home.your code goes here
At 22:08:10 it runs again
Nov 07 22:08:10 openhabian5 systemd[1]: Starting sdrsync.service - Run SD rsync daily except semiannually (when a raw dump is made)...
Nov 07 22:08:10 openhabian5 grafana[286895]: logger=server t=2025-11-07T22:08:10.061228353+01:00 level=info msg="Shutdown started" reason="System signal: terminated"
But this time there is certainly something going wrong
Nov 07 22:10:10 openhabian5 systemd[1]: sdrsync.service: Deactivated successfully.
Nov 07 22:10:10 openhabian5 systemd[1]: Finished sdrsync.service - Run SD rsync daily except semiannually (when a raw dump is made).
Nov 07 22:10:10 openhabian5 systemd[1]: sdrsync.service: Consumed 3.125s CPU time.
Nov 07 22:10:10 openhabian5 systemd[1]: openhab.service: State 'stop-sigterm' timed out. Killing.
Nov 07 22:10:10 openhabian5 systemd[1]: openhab.service: Killing process 286682 (java) with signal SIGKILL.
Nov 07 22:10:10 openhabian5 systemd[1]: openhab.service: Killing process 286835 (java) with signal SIGKILL.
Nov 07 22:10:10 openhabian5 systemd[1]: openhab.service: Killing process 286836 (GC Thread#0) with signal SIGKILL.
Nov 07 22:10:10 openhabian5 systemd[1]: openhab.service: Killing process 286838 (n/a) with signal SIGKILL.
Nov 07 22:10:10 openhabian5 systemd[1]: openhab.service: Killing process 286839 (G1 Conc#0) with signal SIGKILL.
Nov 07 22:10:10 openhabian5 systemd[1]: openhab.service: Killing process 286840 (n/a) with signal SIGKILL.
Nov 07 22:10:10 openhabian5 systemd[1]: openhab.service: Killing process 286841 (G1 Service) with signal SIGKILL.
Nov 07 22:10:10 openhabian5 systemd[1]: openhab.service: Killing process 286842 (VM Periodic Tas) with signal SIGKILL.
Thank you Rich for the suggestion. I think know I have found a part of the problem. It is in the sdrsync.timer file
[Unit]
Description=Run SD rsync daily except semiannually (when a raw dump is made)
[Timer]
Unit=sdrsync.service
#OnCalendar=*-02..06,08..12-* 02:00:00
#OnCalendar=*-01,07-02..31 02:00:00
OnCalendar=*-02..06,08..12-* 00/2:00:00
OnCalendar=*-01,07-02..31 00/2:00:00
RandomizedDelaySec=10m
Persistent=true
[Install]
WantedBy=timers.target
It request to have every two hours a SD rsync
The commented line seems to be the right one : every day at 02:00
I will change this now.
Stays for me 3 questions/problems
- I have not changed the sdrsync.timer file ==> following me it comes as is. Is it normal?
- is it really needed to stop the openhab service for a rsync?
- as the openhab service is stopped there are some items which are losing their value ( I would have expected the items to be persistent and recovered after restart but it doesn’t seems to work. ==> I have to verify )
- I don’t know, I don’t have access to an openHABian onstage right now to look and my production instance runs on Docker.
- Yes. if any of the files change while sync is running the sync will fail.
- That’s to do with your persistence set up. If you only use rrd4j only numbers will be saved and restored. I recommend using rrd4j for charting but mapdb for restoreOnStartup.
Thanks, it makes the thing clear for me.
For #3, it is indeed a string item which is not saved. I will follow your suggestion.