Can't mkdir permission denied

Discussions related to the 1.36.x series of ZoneMinder
Post Reply
adfytr
Posts: 4
Joined: Mon Jul 25, 2022 9:41 am

Can't mkdir permission denied

Post by adfytr »

Managed to install on Arch run by nginx
using nfs as main storage /mnt/hdd/cam-vid path recognized
but receive title error when detecting so no events recorded obviously

chmod 755 on /mnt/hdd
chown by root

what am I doing wrong? thank you
Ralphred
Posts: 32
Joined: Fri Jul 08, 2022 12:23 pm

Re: Can't mkdir permission denied

Post by Ralphred »

You've only set write privilege to the "owner" of /mnt/hdd, the three numbers 7, 5 & 5 are user, group & other respectively.
What you should do is (as root) find out what the primary group ID of your apache2 user is

Code: Select all

grep $(ps aux|awk '/\/apache/ {print $1}'|grep -v $(whoami)|sort -u) /etc/passwd|sed 's/:/ /g'|awk '{print $4}'
set this as the group of /mnt/hdd/

Code: Select all

chown :[gid from above] /mnt/hdd/ -R
and let 'group' have write access

Code: Select all

chmod g+w /mnt/hdd/ -R

If you are feeling lazy, you can add just write access to 'others'

Code: Select all

chmod o+w /mnt/hdd/ -R

You should also

Code: Select all

touch /mnt/hdd/cam-vid/test.deleteme
as root just to prove your nfs exports/fstab are correct too.
adfytr
Posts: 4
Joined: Mon Jul 25, 2022 9:41 am

Re: Can't mkdir permission denied

Post by adfytr »

thank you so much!
i managed to find some instructions (although outdated for conf.d folder and requirement for ZM_DIR_EVENTS=)

and put chown for http:http (since it is nginx) on /mnt/hdd/cam-vid that did the trick
Post Reply