Trouble accessing openhab-share in read-write mode

I’ve recently migrated my openHAB installation from rpi3 to rpi4 and am now facing problems accessing openhab-share:

I’ve used the openhabian-config to create the samba shares and set the access passwords. The problem seems to be somehow related to ACLs (of which I do not have technical knowledge):

# ls -lisa /srv
total 32
 56001 4 drwxr-xr-x   7 openhab openhabian 4096 Dec 16 12:27 .
     2 4 drwxr-xr-x  21 root    root       4096 Aug 20 12:48 ..
512125 4 drwxrwxr-x+  2 openhab openhab    4096 Dec 15 18:01 openhab2-addons
513299 4 drwxrwxr-x+ 16 openhab openhab    4096 Dec 16 15:06 openhab2-conf
391763 4 drwxrwxr-x+  2 openhab openhab    4096 Dec 27 02:01 openhab2-logs
512116 4 drwxrwxr-x+  4 openhab openhab    4096 Dec 15 18:01 openhab2-sys
391765 4 drwxrwxr-x+ 13 openhab openhab    4096 Dec 16 19:53 openhab2-userdata
 11242 4 -rw-rw-rw-   1 openhab openhabian 1430 Dec 15 18:50 README.txt

Here’s an excerpt of my smb.conf:

[openHAB-share]
  comment=openHAB2 combined folders
  path=/srv
  writeable=yes
  public=no
  create mask=0664
  directory mask=0775
  veto files = /Thumbs.db/.DS_Store/._.DS_Store/.apdisk/._*/
  delete veto files = yes

[openHAB-conf]
  comment=openHAB2 site configuration
  path=/etc/openhab2
  writeable=yes
  public=no
  create mask=0664
  directory mask=0775
  veto files = /Thumbs.db/.DS_Store/._.DS_Store/.apdisk/._*/
  delete veto files = yes

As you can see, the setup is the same – but openhab-conf can be accessed in read-write manner, openhab-share cannot.

Does anyone have a clue how I can change this?

Best regards,
cd_

Which user do you use to access the shares ?

I’m using the default openhabian user.

ok.
What does this command return:

getfacl /srv/openhab-*

Here’s the output:

# getfacl /srv/openhab2-*
getfacl: Removing leading '/' from absolute path names
# file: srv/openhab2-addons
# owner: openhab
# group: openhab
user::rwx
group::rwx
other::r-x
default:user::rwx
default:group::rwx
default:other::r-x

# file: srv/openhab2-conf
# owner: openhab
# group: openhab
user::rwx
group::rwx
other::r-x
default:user::rwx
default:group::rwx
default:other::r-x

# file: srv/openhab2-logs
# owner: openhab
# group: openhab
user::rwx
group::rwx
other::r-x
default:user::rwx
default:group::rwx
default:other::r-x

# file: srv/openhab2-sys
# owner: openhab
# group: openhab
user::rwx
group::rwx
other::r-x
default:user::rwx
default:group::rwx
default:other::r-x

# file: srv/openhab2-userdata
# owner: openhab
# group: openhab
user::rwx
group::rwx
other::r-x
default:user::rwx
default:group::rwx
default:other::r-x

Thanks for helping!

Can you also show the result of

mount | grep srv

Yes, sure:

# mount | grep srv
/dev/mmcblk0p2 on /srv/openhab2-sys type ext4 (ro,relatime)
/dev/mmcblk0p2 on /srv/openhab2-addons type ext4 (ro,relatime)
/dev/mmcblk0p2 on /srv/openhab2-conf type ext4 (ro,relatime)
/dev/mmcblk0p2 on /srv/openhab2-logs type ext4 (ro,relatime)
/dev/mmcblk0p2 on /srv/openhab2-userdata type ext4 (ro,relatime)

I opened a github issue: https://github.com/openhab/openhabian/issues/1355
as I was able to reproduce it on a Debian 10 system.
In my installation I modifed the .mount files that are created from the template.
It seems to work as I get rw mounted shares after reboots.

Thank you for creating a ticket over there! Is it somehow hidden? I cannot access it via the above link.

I am new to github. Means that I created an account to raise that ticket.
I see a message that my account was flagged.
So it looks like items that are related to my account are hidden.
I just was contacting the github support to help to resovle this.
Once it is resolved I assume that the tickets will be visible.

1 Like

The ticket should be visible now. Please check and let me know in case it is not.

Happy new year :slight_smile:

I’ve checked the ticket, it is visible now, thank you!

Am I getting it right that this is a problem that can be fixed by adjusting the openhabian-config tool? If so, where can I find the template to adjust? I found such a file at /opt/openhabian/includes/srv_mount_template, is that right? Do I have to just re-run menu 13 after making the adjustments?

Have a blessed New Year.

As long as the fix is not made available via openhabian you need either

  • to edit the template and then rerun openhabian-config menu 13 or
  • edit the files that are created from the template: /etc/systemd/system/srv-openhab*.mount

as long as this is not implemented in openhabian updates of openhabian might overwrite the changes you do on your local files.

Thank you!

I’ve tested that and reported my findings on GitHub!

2 Likes

Thank you all, who contributed here and on GitHub
I had a similar problem with teh shared in ro mode, after a SD card got partially corrupted.
Using the Openhabian interface (13) was a very quick solution.