I get the follow error message when stopping openhab2 as a service:
The unit file, source configuration file or drop-ins of openh
ab2.service changed on disk. Run 'systemctl daemon-reload' to reload units
Even if a run this command I receive this message again after each restart. I googled but I just found some database related topics and they don’t really give a hint what caused this and if I need to take care.
Has anybody a clue how this message should be interpreted.
Thanks. Yes, I already rebooted a couple of times and of course executed the command with sudo.
Could it have something to do with using zram @mstormi ? This was the last major change I did based on your suggestion.
running the daemon-reload does not eliminate the error on the next reboot
So, either something is changing your file, and changing it again at every reboot (virus ) or, more likely, your SD card is failing. One of the signs of a failing SD card, one I’ve seen personally) is when you make a change to a file and the change reverts on a reboot. In my case, it was a log file that stopped rotating (another sign of a failing SD card) where I would manually delete the file but on reboot the file would come back.
Anything that would legitimately change that file (i.e. apt) would run the daemon-reload for you.
Good point. Looking at the script it does appear that it monkeys with the service file.
The function in question is
# create systemd config to enforce delaying rules loading
delayed_rules() {
local targetdir=/etc/systemd/system/openhab2.service.d
if [ "$1" == "yes" ]; then
/bin/mkdir -p $targetdir
/bin/cp "${BASEDIR}"/includes/systemd-override.conf ${targetdir}/override.conf
else
/bin/rm ${targetdir}/override.conf
fi
cond_redirect systemctl daemon-reload
cond_redirect systemctl restart openhab2.service
}
The override.conf file just has some commands to rename the .rules files. wait two minutes, then name them back. My manual install of openHABian (which I may not have done properly or fully years ago when I ran it) doesn’t have that /etc/systemd/system/openhab2.service.d folder so I can’t see how this file is loaded and used. The default openhab2.service file I have doesn’t reference any of this stuff. The open question is whether there are Exec lines that causes the .service files to change during an openHAB start or stop.
That would be highly unusual I believe so I doubt that’s the case but I’m at the end of what I can look at on my own without rebuilding a machine.
It’s a fairly recent systemd feature so it depends on the systemd version to run when you installed that.
See link below. I wouldn’t think systemd would alter its own conf files but who knows. @Lukie you could try verifying this: disable delayed rules (= remove override.conf) and reboot.
Also try if using systemctl edit (should work meanwhile) instead makes a difference.
I’ll give it a go. It’s one of those things that doesn’t happen reliably, and only when stopping or restarting the service (from memory) so I’ve tended to ignore it (with the occasional curse when it happens again). Since it has been raised and discussed I’ll see if I can reliably replicate it and if removing the delayed rules feature stops it from occurring
I have the same issue. After every restart of the OS I get this message. But I don’t use delay of loading rules. At least I haven’t activated something like delay knowingly.
###############################################################################
############### openhab #####################################################
###############################################################################
## Ip = Unable to parse ip . Please debug.
## Release = Raspbian GNU/Linux 10 (buster)
## Kernel = Linux 5.4.51-v7+
## Platform = Raspberry Pi 3 Model B Rev 1.2
## Uptime = 0 day(s). 0:2:19
## CPU Usage = 0.25% avg over 4 cpu(s) (4 core(s) x 1 socket(s))
## CPU Load = 1m: 0.78, 5m: 0.77, 15m: 0.33
## Memory = Free: 0.42GB (44%), Used: 0.52GB (56%), Total: 0.95GB
## Swap = Free: 2.39GB (100%), Used: 0.00GB (0%), Total: 2.39GB
## Root = Free: 19.46GB (70%), Used: 8.31GB (30%), Total: 28.99GB
## Updates = 9 apt updates available.
## Sessions = 1 session(s)
## Processes = 128 running processes of 32768 maximum processes
###############################################################################