Zoneminder saving to FreeNAS - Help please.

Status
Not open for further replies.
Joined
Jun 24, 2017
Messages
338
Hey guys... So, I'm trying to get my Zoneminder 1.29 to save to my NFS shared FreeNAS... or something along those lines.
I have an Ubuntu box running Zoneminder 1.29 that works fine standalone... Im trying to have its files saved to my FreeNAS from a mount on Ubuntu... Basically, Ubuntu boots, mounts the FreeNAS by IP (FreeNAS is: /mnt/Storage/all_my_files. Ubuntu mounts at /mnt to /all_my_files. through FSTAB at boot. Fstab line is:
192.168.1.3:/mnt/Storage /mnt nfs defaults 0 0
and it works perfectly fine for all other things.
Im trying to get stab to mount a subfolder like:
/mnt/zoneminder/events /var/cache/zoneminder/events none defaults, bind 0 2
(same for images, just replace /events with /images

additionally, I tried mounting directly as:
192.168.1.3:/mnt/Storage/zoneminder/events /var/cache/zoneminder/events nfs defaults, bind 0 2
ZoneMinder keeps kicking back "Cannot write to content dirs('events','images'). Check that these exist and are owned by the web account user"

I assume it has to do with zone minder using www-data as the user, and I'm not sure how to set the permissions on the FreeNAS to allow it to write...
Ive tried setting permissions to the zone minder subfolder on the FreeNAS from FreeNAS' shell... doesn't do anything.
Ive tried setting permissions to /mnt/zoneminder directly in Ubuntu, but it doesn't have permission to change permissions...

I tried running a virtual box to satiate my need for an external server... unfortunately, I get major issues with stalling in SAB and MySQL when running a virtual box directly in FreeNAS.... and frankly Im fine with 2 boxes doing the job as I can not stand the lag of just 1 doing it :) (read: it pisses off my wife)

If that's not enough info, please ask and ill supply whatever I know.
 

scrappy

Patron
Joined
Mar 16, 2017
Messages
347
You're on the right track. I would suggest creating user/group www-data on FreeNAS using the same GID and UID from www-data on Ubuntu. You can find those properties with: id www-data from Ubuntu's terminal. Then, change ownership on the FreeNAS dataset you want to share with Zoneminder to: www-data:www-data.

On Ubuntu, I suggest not mounting datasets directly to /mnt. You need to create a directory after /mnt such as: /mnt/Storage. That way, you can change ownership of /Storage to www-data:www-data

I also use Zoneminder on Ubuntu and this is how I have my NFS mount setup in /etc/fstab:
Code:
192.168.3.102:/mnt/tank/surveillance   /mnt/surveillance   nfs   rw,sync,hard   0   0

I only use surveillance dataset for recording video/images. For all other data I just let zoneminder write inside the VM.
 

scrappy

Patron
Joined
Mar 16, 2017
Messages
347
Oh yeah, I forgot to actually answer your question about changing ownership. Once you've created a Storage directory in Ubuntu (using # mkdir -p /mnt/Storage), change ownership with # chown -R www-data:www-data /mnt/Storage/. Now, Zoneminder will have full read write access to your mounted dataset
 
Joined
Jun 24, 2017
Messages
338
Got it to work... not EXACTLY sure how I did it.. It's funny though.. I think part of the problem was not actually changing the path in ZoneMinder's settings and instead trying to build symlinks to get it to work... now I've got to go back and clean up the mess I've made :) it was not pretty when it was all said and done.
Thanks for the help Scrappy!!!! You definitely pointed me in the right direction!
 
Status
Not open for further replies.
Top