acutally i am setting up a new openhab instance.
For automatic deployment of configuration files i want to use my gitlab instance.
Until now i triggered a ansible-playbook (also with rsync task) but now i want to handle the sync process completely in the gitlab-ci.yml
The sync of the files is working fine, but file updates aren’t recognized by openhab - i have to restart the openhab service to take effect of changes.
My “old” ansible playbook:
- name: Deploy openhab config
- name: Clone openhab config from gitlab repo
repo: email@example.com:homelab/openhab.git # noqa: latest
- name: Synchronize and delete files in dest on the remote host that are not found in src of localhost.
# - "--chmod=F755"
- name: Recursively remove directory
Unless you installed openhab in its own way from root account this is not going to fly. As far I remember openHAB rpm/deb/apt package uses its own user - openhab. Make sure these files are readable by user account used by openhab process.
this was my first thought, too.
its correct, that the files/folders after installation had “openhab” as owner and group.
but the files are readable for openhab, because after a restart of the service they are recognized.
Even when i upload a file as root user the update works.
So i think there has to be another reason why the config isnt updated immediately…
If permissions are fine maybe file modified/changed time is not amended? I think that file monitoring works based on modified time, so if your script keeps all attributes intact, but changes contents, monitors will be blind for updated content until restart.
The timestamp of the files change, too. Its really strange.
In the logs of Openhab i get sometimes this error - but i am not quite sure if its related to the file updates?
at java.util.concurrent.ConcurrentHashMap.putVal(ConcurrentHashMap.java:1011) ~[?:?]
at java.util.concurrent.ConcurrentHashMap.put(ConcurrentHashMap.java:1006) ~[?:?]
at org.openhab.core.internal.service.WatchServiceImpl.notifyListeners(WatchServiceImpl.java:256) ~[?:?]
at org.openhab.core.internal.service.WatchServiceImpl.lambda$4(WatchServiceImpl.java:231) ~[?:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) ~[?:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
at java.lang.Thread.run(Thread.java:833) ~[?:?]