Having a little trouble. I’ve been designing rules for my automation, and I’ve been getting tired of editing in nano, because it takes forever to figure out which functions to use. So I’ve decided to start using eclipse home designer. This software works great! I’m just having one minor obstacle, which makes it impossible to use.
I use a mac (mainly), and I’d like to edit my rules on the raspberry pi 3 through samba. The only problem is, I can’t seem to get write permissions on the /etc/openhab2 folder!
I’ve added both the pi user and the openhab user to the smb password database with smbpasswd -a USER
I’ve decided to backup the pre-fab samba configuration and start bare-bones. I found these settings in another topic, but they didn’t work so I commented out what I thought wasn’t a necessity
;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
path = /etc/openhab2/
force user = openhab
;available = yes
;read only = no
;browseable = yes
;public = no
;writeable = yes
That’s probably because openhab wants to own /etc/openhab2. I modded permissions for the folder to see if pi was able to edit it, but it was not. I changed the owner back to openhab:openhab.
tried forcing user and group. Also tried forcing directory mode 2775 but it just won’t give me read& write permissions -_-
path = /etc/openhab2/
#force user = openhab
available = yes
read only = no
browseable = yes
public = no
writeable = yes
force user = openhab
force group = openhab
force directory mode = 2775
I’m starting to think I need to add the samba daemon to the sudo’ers file or something like that. I think the pi is not giving samba full access. Why? Because even when I connect to samba using the openhab user I don’t get write permissions.
That will not make a difference. Samba doesn’t know how to use sudo.
Did you think about using openHABian? It includes all tools useful for openHAB, including a fully working samba configuration. Instead of hacking around yourself you can have a system up in less than one hour that is known to work reliably. Also if you find room for improvement, you can discuss this in the community and everyone will benefit from it.
Thanks for the tip on openhabian, but as I have invested many hours in my current pi configuration I prefer keeping that the way it is.
Furthermore, it shouldn’t make that much of a difference. I use raspbian, which should also run samba just fine as it’s also based on debian. Maybe I used the wrong apt-get command. I purged samba completely and am now reinstalling, maybe that helps. If that doesn’t fix it I will try using the openhabian config thanks!
You can use the openhabian-config tool on an existing debian/ubuntu installation. If your system is a standard raspbian, there shouldn’t be an issue. Give it a try, then select samba and see what happens.
From the documentation. http://docs.openhab.org/installation/linux.html#network-sharing
Make sure that whatever user you’re using to connect to the share with also has read/write access to the files on the pi. e.g. “ls -l” Just setting the Samba ACL level will not do any good if the filesystem is restricting access.
comment=openHAB2 site configuration
Have you checked the actual permissions on your configuration folder?
ls -l /etc/openhab2
It may be worth just resetting the ownership on the entire folder just so that you know it’s at a consistent state.
sudo chown -R openhab:openhab /etc/openhab2
There are two sets of permissions you have to consider with a network share. The filesystem permissions that govern what users on the machine have access to what, and the samba permissions which govern the permissions on a network level.
You can set samba wide open at 777, but if the filesystem is set to 755 with the owner set to root your user still isn’t going to be able to modify the files.
Thanks, your link to the documentation helped fill in some blanks. I did not find them using google unfortunately.
I managed to get it running using ls -l. Found some inconsistencies (apparently chown -R does NOT recurse in to directories within a directory??) chowning all files to openhab:openhab again to be safe.
when I log in as openhab on samba I can now write the files.
It does. That’s how I fix up the owner:group on my Pi openHAB files.
One thing to watch for… I’ve had issues with openHAB trying to read a file before it’s been completely written over SMB. It results in strange errors in the log file, but the files load correctly if they are touched to trigger a reload.