Zoneminder on FreeNAS

Status
Not open for further replies.

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Very interesting thread. I'm currently experimenting ZoneMinder 1.29.0 in a VirtualBox CentOS VM hosted on my FreeNAS System.
I'll migrate to a Jail as soon as I feel more confortable with it.

Any chance to see a plugin one day ?
a plugin sounds nice, it shouldn't be too hard. though I don't have a lot of motivation cause that's how my system is setup. but with docker, people could write one pretty easily.

one thing everyone here is missing is mounting tmpfs to /tmp, which helps performance of analyzing/writing frames. you guys could do this with a startup command
 

Marcet

Contributor
Joined
May 31, 2013
Messages
193
a plugin sounds nice, it shouldn't be too hard. though I don't have a lot of motivation cause that's how my system is setup. but with docker, people could write one pretty easily.
You're right, I didn't thought about Docker. I'm not very familiar with it.

I will try to install it on my test system before doing anything serious with it.

one thing everyone here is missing is mounting tmpfs to /tmp, which helps performance of analyzing/writing frames. you guys could do this with a startup command
Can you be more precise ? You mean /tmp of the main system ?

Also which release of ZoneMinder are you running ? 1.30 ? Is it stable ?

I didn't find any export / import feature for camera settings. Do you know how to do that manually ? Simply export mysql database ?
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
You're right, I didn't thought about Docker. I'm not very familiar with it.

I will try to install it on my test system before doing anything serious with it.


Can you be more precise ? You mean /tmp of the main system ?

Also which release of ZoneMinder are you running ? 1.30 ? Is it stable ?

I didn't find any export / import feature for camera settings. Do you know how to do that manually ? Simply export mysql database ?
well docker isn't available for freenas 9.10, just saying it will be a simple way for someone to package together a ZM plugin for freenas10.

as for tmpfs, you would want it mounted in your jail. ZM writes a lot of data to its buffer and keeping this on tmpfs can avoid IO issues.
a preinit command in freenas like the following would probably do the trick.
/sbin/mount -t tmpfs -o size=3G tmpfs /mnt/tank/jails/ZM_jail/tmp

do check what size your camera setup is currently taking. my 4*3MP camera takes a little over 2GB, this depends on your resolution/color/prebuffer settings.
 
Last edited:

Marcet

Contributor
Joined
May 31, 2013
Messages
193
as for tmpfs, you would want it mounted in your jail. ZM writes a lot of data to its buffer and keeping this on tmpfs can avoid IO issues.
a preinit command in freenas like the following would probably do the trick.
/sbin/mount -t tmpfs -o size=3G tmpfs /mnt/tanks/jails/ZM_jail/tmp

do check what size your camera setup is currently taking. my 4*3MP camera takes a little over 2GB, this depends on your resolution/color/prebuffer settings.
Thanks.

I'm in process of adding new cameras, so I will test on FreeNas when I'm done.
 

Marcet

Contributor
Joined
May 31, 2013
Messages
193
I made my way on VirtualBox, having a fully running ZoneMinder server on CentOS guest.

Now it's time for me to make it serious installing it in a FreeNas Jail.

I've easily installed the packages using
Code:
pkg install zoneminder nginx mysql56-server php70-pdo_mysql php70-gd fcgiwrap php70-session


But as I'm mostly a Linux guy, and a beginner with FreeBSD, I have trouble with the post install setup.

Where to find my.cnf ? How to configure nginx ?

For my.cnf, I've copied /usr/local/share/mysql/my-default.cnf to /var/db/mysql/my.cnf
I don't know if it's the way to go.

Is there somewhere a more step by step instructions ?
 

Cesaric

Cadet
Joined
Dec 2, 2015
Messages
8
not sure what you are asking, but we did integrate some fixes into the port (which may be built for pkg by now) last week.
https://github.com/freebsd/freebsd-ports/commit/8d5ce6a1bc7f1ce090c35dfb5472274281bb4bd8

You might not even need to specify 'php70-pdo_mysql php70-gd php70-session' anymore.

I was about to post an issue with sockets (PHP Fatal error: Uncaught Error: Call to undefined function socket_create()) and saw that you've updated the port with that fix. I updated zoneminder and that socket error is cleared up now. Thanks!
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
I made my way on VirtualBox, having a fully running ZoneMinder server on CentOS guest.

Now it's time for me to make it serious installing it in a FreeNas Jail.

I've easily installed the packages using
Code:
pkg install zoneminder nginx mysql56-server php70-pdo_mysql php70-gd fcgiwrap php70-session


But as I'm mostly a Linux guy, and a beginner with FreeBSD, I have trouble with the post install setup.

Where to find my.cnf ? How to configure nginx ?

For my.cnf, I've copied /usr/local/share/mysql/my-default.cnf to /var/db/mysql/my.cnf
I don't know if it's the way to go.

Is there somewhere a more step by step instructions ?
that's correct for my.cnf
/usr/local/etc/nginx/nginx.conf is the nginx location
 

melloa

Wizard
Joined
May 22, 2016
Messages
1,749
I made my way on VirtualBox, having a fully running ZoneMinder server on CentOS guest.

Now it's time for me to make it serious installing it in a FreeNas Jail.

I've easily installed the packages using
Code:
pkg install zoneminder nginx mysql56-server php70-pdo_mysql php70-gd fcgiwrap php70-session


But as I'm mostly a Linux guy, and a beginner with FreeBSD, I have trouble with the post install setup.

Where to find my.cnf ? How to configure nginx ?

For my.cnf, I've copied /usr/local/share/mysql/my-default.cnf to /var/db/mysql/my.cnf
I don't know if it's the way to go.

Is there somewhere a more step by step instructions ?

Did you see my post with the step by step install? Is attached to one my my messages here. I did test it on FreeBSD and FreeNAS jail and worked fine.
 

Marcet

Contributor
Joined
May 31, 2013
Messages
193

Marcet

Contributor
Joined
May 31, 2013
Messages
193
Did you see my post with the step by step install? Is attached to one my my messages here. I did test it on FreeBSD and FreeNAS jail and worked fine.
I did not read it all, stupid me :D

Thanks for the guide.
 
Last edited:

Marcet

Contributor
Joined
May 31, 2013
Messages
193
General question : Which is the best way to go ports or pkg ?
 

Marcet

Contributor
Joined
May 31, 2013
Messages
193
General question : Which is the best way to go ports or pkg ?
Got the answer (I've tried both). The best is pkg, because it's much quicker and no hassle.
The question remains (philosophically speaking) for FreeBSD in general. I want answers :D

@melloa Thanks for your convenient guide.

Anyway, I have two questions :

1) @melloa my /etc/fstab is empty. Is it normal ? Moreover, and after @Joshua Parker Ruehlig remarks about tmpfs, I'm feeling a bit lost.
What I am supposed to do ? Sorry to be so stupid on that question.

2) How to configure a dataset for events storage ?

Thanks for your patience guys ;)
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Got the answer (I've tried both). The best is pkg, because it's much quicker and no hassle.
The question remains (philosophically speaking) for FreeBSD in general. I want answers :D

@melloa Thanks for your convenient guide.

Anyway, I have two questions :

1) @melloa my /etc/fstab is empty. Is it normal ? Moreover, and after @Joshua Parker Ruehlig remarks about tmpfs, I'm feeling a bit lost.
What I am supposed to do ? Sorry to be so stupid on that question.

2) How to configure a dataset for events storage ?

Thanks for your patience guys ;)
/etc/fstab is for a system that has control of its own file mounts, which a FreeNAS jail does not.

If you want to get the increased performance from tmpfs I recommend you use a FreeNAS pre-init command to mount it as I specify here.
https://forums.freenas.org/index.php?threads/zoneminder-on-freenas.14463/page-10#post-297274

####

Mount a dataset into your jail using the Jails > Storage tab. I'd use something like /mnt/ZM in the jail.
change Options > Path > DIR_EVENTS = /mnt/ZM/events & DIR_IMAGES = /mnt/ZM/images
 

ideal2545

Dabbler
Joined
Jun 1, 2015
Messages
25
Version 1.01 - Added pkg install option.

Thanks for this! Got it working within 20 minutes with the pkg install option - one thing I am noticing in the logs, alot of errors with sockets... socket_sendto errors, stuff like this: socket_sendto( /var/run/zm/zms-906666s.sock ) failed: No such file or directory

have you (or anyone else) seen this and found a way to stop them?
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Thanks for this! Got it working within 20 minutes with the pkg install option - one thing I am noticing in the logs, alot of errors with sockets... socket_sendto errors, stuff like this: socket_sendto( /var/run/zm/zms-906666s.sock ) failed: No such file or directory

have you (or anyone else) seen this and found a way to stop them?
I see them alot. not sure if there is a way to stop them. I know @abi has been debugging and been getting rid of bugs that cause some.
maybe some are related to one process trying to connect while another process is starting up, might be unavoidable by the nature of ZM
 

Marcet

Contributor
Joined
May 31, 2013
Messages
193
/etc/fstab is for a system that has control of its own file mounts, which a FreeNAS jail does not.
Got it. I should have realize that... I'm more familiar to VMs than Jails. Still learning ;)

If you want to get the increased performance from tmpfs I recommend you use a FreeNAS pre-init command to mount it as I specify here.
https://forums.freenas.org/index.php?threads/zoneminder-on-freenas.14463/page-10#post-297274
Just to be sure. You mean Task -> Add Init/Shutdown Script ?

Mount a dataset into your jail using the Jails > Storage tab. I'd use something like /mnt/ZM in the jail.
change Options > Path > DIR_EVENTS = /mnt/ZM/events & DIR_IMAGES = /mnt/ZM/images
Ok. Thanks. That part will be easy.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Got it. I should have realize that... I'm more familiar to VMs than Jails. Still learning ;)


Just to be sure. You mean Task -> Add Init/Shutdown Script ?


Ok. Thanks. That part will be easy.
yeah, haven't tested it myself but the output of 'mount | grep tmpfs' would show if it worked.
 

Marcet

Contributor
Joined
May 31, 2013
Messages
193
yeah, haven't tested it myself but the output of 'mount | grep tmpfs' would show if it worked.
Unfortunately it doesn't.

BTW: My jail is up and running. Thanks for your help guys.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Unfortunately it doesn't.

BTW: My jail is up and running. Thanks for your help guys.
this is after a reboot, and you modified the command I posted for your jail location?
 
Status
Not open for further replies.
Top