Karaf Command History Not Saving - Seeking Solutions

Hi everyone, I’m reaching out for some assistance with an issue I’ve encountered while working with Karaf. I’ve recently set up my environment, and everything seems to be running smoothly except for one minor but annoying problem: the command history isn’t saving.

Every time I restart Karaf, it’s like I’m starting fresh—I can’t recall any previous commands, which is a bit inconvenient when I’m trying to troubleshoot or repeat something I did earlier. I checked the logs, and I see this error message:

2022-01-24 11:25:00.506 [WARN ] [org.jline ] - Failed to save history java.nio.file.AccessDeniedException: /var/lib/openhab2/.karaf/karaf.history

It looks like Karaf is trying to save the history to the wrong directory, and it doesn’t have the right permissions. I’ve tried changing the directory where the history is saved, but I haven’t had any luck so far. I found a related issue on GitHub (here), but the suggested fixes didn’t work for me.

Has anyone else encountered this issue? If so, how did you resolve it? I’m particularly interested in whether there’s a way to configure Karaf to point to the correct directory without having to change permissions on the existing directory. Any advice or insights would be greatly appreciated!

Thanks in advance for your help!

Best regards,
[Your Name]