Page 1 of 1

Failed permissions using Systemd mount with CIFS

Posted: Wed Oct 06, 2021 10:31 am
by texastexas
I tried to use a systemd cifs mount of my NAS as outlined in:

https://wiki.zoneminder.com/Common_Issu ... ive_or_NAS

Everything went well except I get permission errors for events and images:

"Cannot write to event folder /var/cache/zoneminder/events. Check that it exists and is owned by the web account user."

I tried setting www-data:www-data permissions with chown, but with systemd, one cannot alter permissions with chown.

Has anyone done this before and resolved the permissions?

Everything n is great except this one problem.

Thanks

Re: Failed permissions using Systemd mount with CIFS

Posted: Wed Oct 06, 2021 2:25 pm
by mikb
Although you don't mention the filesystem in use, CIFS/SMB mounts usually imply that your filesystem in the NAS is something like FAT32.

If so, there is no proper concept of "permissions" and "users", which causes all sorts of problems. Nor does it understand symbolic links, which are used by Zoneminder. Even without systemd getting in your way, chown can't change ownership if the filesystem doesn't support "ownership".

There are workarounds to make the apparent owner/group of the entire disk (when mounted) to be a particular user/group, but that won't fix symbolic links.

e.g. having to plaster on mount options like "file_mode=0666,dir_mode=0777,username=public%PASSWORD,nounix,noperm,noserverino" just to try and get things working. "No this, no that, no the other, just get out of my way and let me write, okay?" :)

You need a real file system, and a sharing protocol that can reliably transfer these concepts back and forth without mangling them.

Re: Failed permissions using Systemd mount with CIFS

Posted: Wed Oct 06, 2021 8:08 pm
by texastexas
I have a TrueNAS NAS. I can offer it up as a CIFS or NFS. I used CIFS because I knew sharing better and there was an example in the wiki, but I'd go for NFS if that solves it.

Do you know of a good example of a Free(True)NAS systemd example for zoneminder I might check out? I get hung up on the options and how to do user/PWs.

Re: Failed permissions using Systemd mount with CIFS

Posted: Thu Oct 07, 2021 3:36 pm
by mikb
texastexas wrote: Wed Oct 06, 2021 8:08 pm I have a TrueNAS NAS. I can offer it up as a CIFS or NFS. I used CIFS because I knew sharing better and there was an example in the wiki, but I'd go for NFS if that solves it.

Do you know of a good example of a Free(True)NAS systemd example for zoneminder I might check out? I get hung up on the options and how to do user/PWs.

Whatever sharing protocol is in use (SMB/CIFS/NFS), if the underlying filesystem doesn't understand permissions and symbolic links, nothing will change.

I can arrange to share out a FAT32 filesystem by NFS protocol, but I wouldn't hold out much hope of it working :)

You need to check what the filesystem is used internally to the NAS.