I’m brand new to openhab, still trying to install it.
I don’t know if it matters but I installed openhab with apt
I want to run openhab under a different user than openhab.
From what I can tell all I should have to do is
edit /etc/default/openhab to
USER_AND_GROUP=newuser:newuser
then ensure newuser is part or openhab group
usermod -a -G openhab newuser
but when i run
systemctl restart openhab.service
systemctl status openhab.service
I get
Invalid Configuration LocationThe configuration area at '/var/lib/openhab/workspace' is not writable. Please choose a writable location using the '-configuration' command line option.
I get the same when I try
USER_AND_GROUP=newuser:openhab
It seems to work fine if i leave it as openhab:openhab, or if i run it through command line.
I’m assuming this is openHAB 1.8. That folder right now has only read permissions on the workspace folder. You should be able to make it work if you give the group write permissions:
sudo chmod -R g+w /var/lib/openhab/workspace
But be careful. There is a script /user/share/openhab/bin/setpermissions.sh which gets run every time OH starts which changes the permissions on a bunch of files, possibly include this folder. You will want to review this script if after restarting OH the error persists and comment out the lines that reset the workspace folder.
The setpermissions.sh script definitely sets all directories and files defined in in openhab.in.sh to have group permissions r-x (755).
I changed setpermissions.sh to use 775 instead of 755 in setPermRecursive()
Unfortunately I still get the same error.
Invalid Configuration LocationThe configuration area at ‘/var/lib/openhab/workspace’ is not writable. Please choose a writable location using the ‘-configuration’ command line option.
After restarting the service I confirmed the permissions under /var/lib/openhab/workspace are 775.
Looking at openhab.sh it looks like the jar is being run with -configuration ${OPENHAB_WORKSPACE_DIR} and openhab.in.sh is defining OPENHAB_WORKSPACE_DIR as /var/lib/openhab/workspace
So all the code I can see looks to be setup correctly now but it still fails.