Openhab2 on Openmediavault - location of configuration files

Hi,
my problem is that Openmediavault does not allow to expose directories on the installation disk using Samba. Therefore I cannot edit the configuration files using Eclipse on my Windows PC.
I tried to work around the problem using symbolic links, but I was not successful with it.
Is there a way to configure openhab2 to read the configuration files from a different location than /etc/openhab2/ ? This would enable me to store the configuration files on a Samba share.

Many thanks for your help,
Burgisch

Maybe it’s possible to symlink /etc/openhab2 to another folder?

Hi Ude, many thanks for your suggestion.
I tried this, I created the symlinks in an existing and accessible samba share. However I could not manage to access the linked files using samab due to authorization conflicts. I double checked that the files in /etc/openhab2/ do have the same owners and user rights as the other files in the samab share which I can access, however the system seems to protect the files on /etc/. This might be a problem which could be addressed to the Openmediavault comunity.
But is there really no way to configure alternative locations for the configuration files?

Many thanks,
Jörn

Yes, that is correct. I thought it the other direction, to create the real files in a samba share and to create the symlink in /etc/openhab2/ :slight_smile:

But of course you also could set up samba to allow following symlinks (this will, however, result in a security issue).

Hi Odo, I also tried it the other way around, but it looks like Openhab does not read symlinked directories.
I now installed Virtualbox and I am running openhab in a virtual machine on Openmediavault. This works great, and maybe it is even the better solution as I can play around without the risk of damaging the main system and I can take snapshots very easy.

Thanks for the help,
Burgisch

Not sure if this is still relevant but it comes up as first result if searching for openhab, omv and samba. I achieved this by adding a few options to the global extra options for SMB in OMV:

  • follow symlinks = yes
  • wide links = yes
  • unix extensions = no

Step by step:

  • Adding one of my personal users (joe) to the group openhab
  • Creating a folder “openhab” on my shared disk
  • creating two symlinks below it
    • ln -s /var/lib/openhab2 /srv/dev-disk-by-label-XYZ/openhab/userdata
    • ln -s /etc/openhab2 /srv/dev-disk-by-label-XYZ/openhab/conf
  • Adding a shared folder for samba and grant access to joe
  • Add the options above
  • Apply

This comes with a security issue: https://www.samba.org/samba/news/symlink_attack.html

Not an issue for me at all, but it will depend on what you do.