"openhab" user owner of Configurations causing problems for Designer?

I rebuit a clean Raspbian image on Rpi2 and installed openhab using apt-get (per github)
Some things such as auto booting worked way better using apt-get than my previous attempt from zip, but…

I have had no luck getting openhab-designer (windows) to connect via samba and I think it has something to do with a user “openhab” on things in the configuration directory. I don’t I have an openhab user (I think I have just root and pi).

From the windows computer I can log in to the samba share on the RPi2,
I can run designer and point it to the RPi2 share, but the “Configurations” pane in the upper left is always empty rather than containing Items, Persistensce, Rules, etc.

If I put the configurations directory on a NAS storage device with no security then designer opens it fine and the “Configurations” pane works fine.

Can someone tell me the best way to fix?

If you installed using apt-get you now have an openHAB user and openHAB is running as that user.

Since you are sharing /etc/openhab/configurations over Samba you need to make sure that whatever user that your Samba clients are connecting as have full read/write permission on that folder.

Thanks for responding.

I have tried:
cd /etc/openhab
sudo chmod -R 777 configurations/

But that hasn’t worked. Do I need to somehow get rid of “openhab” being “owner”?
If so, how?

Or should I create an “openhab” user?
If so, where else might I need to add that user? (samba, or other?)

Take a look here, worked also for me:

Continuing the discussion from Using openHAB designer on Windows with openHAB on Linux:

And as @rlkoshak already said, if you installed via apt-get you HAVE already an user “openhab”.

Thanks sihui and Rich - you have helped me understand my problem.
I copied the “configurations” work that I did on a previous system to my NAS (network drive).
Rebuilt RPi2, reinstalled OpenHAB and then copied the configurations directory back to RPi2 which probably jazzed up the ownership/security.

What should security be on my /etc/openhab/configurations/ and it’s underlying files?

Using “ls -l” Mine are now: configurations:
drwxrwxrwx 8 root root 4096 Dec 15 10:23 configurations

And within configurations:
-rwxrwxrwx 1 pi pi 70693 Dec 12 17:33 default.cfg drwxrwxrwx 2 root root 4096 Dec 15 10:23 items -rwxrwxrwx 1 pi pi 2525 Jul 31 12:03 logback_debug.xml -rwxrwxrwx 1 pi pi 2311 Jul 31 12:02 logback.xml -rwxrwxrwx 1 pi pi 70695 Jul 31 12:03 openhab_default.cfg drwxrwxrwx 2 root root 4096 Dec 15 10:23 persistence drwxrwxrwx 2 root root 4096 Dec 15 10:23 rules drwxrwxrwx 2 root root 4096 Dec 15 10:23 scripts drwxrwxrwx 2 root root 4096 Dec 15 10:23 sitemaps drwxrwxrwx 2 root root 4096 Dec 15 10:23 transform -r--r----- 1 openhab openhab 24 Jul 31 12:02 users.cfg

can someone that has installed via apt-get and has things working tell me what they have for:
cd /etc/openhab/configurations/
ls -l

I actually source control my configurations using git. So what I did was create a repository in my home directory for the configs(and webapps) and soft link that folder to /etc/openhab. But I don’t share my configs over Samba so YMMM.

rich@chimera:~$ ls -l /etc/openhab
lrwxrwxrwx 1 root root 33 Jun 17 10:51 /etc/openhab -> /home/rich/Documents/code/openhab

rich@chimera:~$ ls -l /etc/openhab/configurations/
total 176
drwxr-xr-x 2 rich    rich     4096 Oct 14 15:21 items
-rw-r--r-- 1 rich    rich    69900 Oct 23 15:14 openhab.cfg
-rw-r--r-- 1 root    root    70695 Jul 31 15:43 openhab_default.cfg
drwxr-xr-x 2 rich    rich     4096 Oct  8 13:38 persistence
drwxr-xr-x 2 rich    rich     4096 Sep  1 14:39 rules
drwxr-xr-x 2 rich    rich     4096 Dec 11 15:22 scripts
drwxr-xr-x 2 rich    rich     4096 Oct 23 12:44 sitemaps
drwxr-xr-x 2 rich    rich     4096 Aug  3 13:12 transform
-rw-r--r-- 1 rich    rich       28 Jun 17 10:44 user.cfg.old
-r--r----- 1 openhab openhab    42 Jun 18 08:51 users.cfg

You need to have everything under user:group openhab:openhab.
In addition to that I had to chmod all files to 0777.
Since then Designer under Windows is able to read/write config files on Raspberry.

Good luck.

pi@raspberrypi2 /etc/openhab/configurations $ ls -l
insgesamt 180
drwxrwxrwx 2 openhab openhab  4096 Dez 16 12:33 items
-rwxrw-rw- 1 openhab openhab 79240 Dez 15 23:11 openhab.cfg
-rwxrw-rw- 1 openhab openhab 70695 Dez  5 08:40 openhab_default.cfg
drwxrwxrwx 2 openhab openhab  4096 Dez 16 12:33 persistence
drwxrwxrwx 2 openhab openhab  4096 Nov  8 13:30 rules
drwxrwxrwx 2 openhab openhab  4096 Nov  1 08:37 scripts
drwxrwxrwx 2 openhab openhab  4096 Nov  8 14:51 sitemaps
drwxrwxrwx 2 openhab openhab  4096 Nov  1 08:37 transform
-r--r----- 1 openhab openhab    24 Nov  1 08:34 users.cfg

Thank you both SO MUCH!

My issue ended up being caused because I used samba to share the /etc/openhab/configurations directory.

I needed to share it’s parent directory:
/etc/openhab/

So in designer, it asks for the configurations directory and you point it to the configurations directory but designer appears to rely on the ability to look one level up from that directory in order to fully function.

Thanks again guys.
Problem solved.

Can I ask, what is in your SMB global settings? I’m trying to share my /etc/openhab2 folder through SMB, bu thave no luck getting write permissions from my macbook.

I’ve added both user pi and user openhab to the smb users using smbpasswd -a [USER]

I’ve been trying since last night with the default config file, but I chose to go bare bones to give myself a break :smile:

[global]
;server string = Samba Server Version %v
security = USER
;log file = /var/log/samba/log.%m
;max log size = 50
;idmap config * : backend = tdb
;hosts allow = 10.0.1.0/24
;cups options = raw

[openhab2]
path = /etc/openhab2/
force user = openhab
;available = yes
;read only = no
;browseable = yes
;public = no
;writeable = yes
;create mask=0777
;directory mask=0777
;only guests=no

The only change I ever made to that section was:

security = USER

The only password I did set up was sudo smbpasswd -a pi

This always has worked fine (reading and writing) with the above config:

Edit: I don’t remember the reason but I added

force user = openhab
force group = openhab

to the smb.conf a while ago …