Tag Archives: zoneminder

Zoneminder can’t chmod /dev/videoN, operation not permitted, and not starting at boot

Zoneminder has reached its current peak with version 1.24.2 since quite some time, so you can finally get it off the official repositories of Ubuntu, instead of finding then the older 1.23 as it was at the time of Jaunty, when you had to compile off the source.

Running configure and make install comes with the added benefit of making you feel nerdy, but it’s still a pain, and why doing it when you can download a deb to install it automatically?

So well, when I installed off the repos in Lucid everything went fine since the beginning, I only had to load http://localhost/zm in Firefox to get it going.

This time after upgrading to Maverick (on a new hard disk, so new fresh install), I instead faced some errors.

First I couldn’t get to the console URL, but this thread at UbuntuForums gave the solution:

sudo ln -s /etc/zm/apache.conf /etc/apache2/conf.d/zoneminder.conf

to create a link between Apache’s configuration file and Zoneminder’s shipped one, and then

sudo /etc/init.d/apache2 reload

to have Apache refresh its configuration from said file; after this, the console’s web GUI can be reached under the /zm subfolder of the webserver root.

Then, I had another problem where the sources appeared red no matter what; enabling debug I found an error relating to zmfix not being able to apply a chmod on /dev/videoN, since the operation was not permitted. Manually doing:

sudo chown www-data /dev/video*

and restarting zoneminder with

sudo /etc/init.d/zoneminder restart

solved it, but didn’t survive a reboot, as the ownership of /dev/video* goes back to root:video.

What did it for me was a:

sudo adduser www-data video

as suggested in this topic on ZoneMinder forums.

So this solved the operation not permitted error, but I was still getting an unresponsive ZoneMinder console after reboot, the status was reported as “Stopped”, and after manually starting it all went fine; there had to be something preventing ZoneMinder from properly and automatically start right after first run, so searching I found a tip in ZoneMinder Wiki, that suggested the problem lying in Ubuntu starting ZoneMinder so soon that MySQL wasn’t ready yet; delaying the start of ZoneMinder solves this, so you just need to add

sleep 15

before

zmfix -a

in the ZoneMinder startup script, which is, in the standard repository installation, /etc/init.d/zoneminder

Enjoy your videosurveillance!

sudo /etc/init.d/apache2 reloadsudo /etc/init.d/apache2 reload