Zoneminder 1.27.0

Forum for questions and support relating to the 1.27.x releases only.
Locked
milonz
Posts: 1
Joined: Sat Sep 06, 2014 9:09 pm

Zoneminder 1.27.0

Post by milonz »

Hello,

i'm using Zoneminder for two years now (from the official Ubuntu 12.04 repository and now from the PPA, as i've tried it today)
It's a good piece of software, but i always was baffled by some functionnalities which were never fully implemented and thus misguiding, like the autorisations, and the last version 1.27.0 seems even worse that the older ones.

The config file /etc/zm/zm.conf was designed to use different web users (ZM_WEB_USER and ZM_WEB_GROUP), which in my case is not www-data.
As a matter of fact, there's plenty of good reasons to run Apache and Zoneminder as an another user, the more obvious is when you want ZM to access a NFS folder, with some fixed user.
It's not the most common situation for everybody, but the most common when you set up ZM as a professional (you don't use local disks, but some remote fat NAS, which is not the ZM server).
As the files ZM writes must have some specific owner, the ZM daemon and Apache must run on this specific user.

It's easily done within Apache, but it's a not well implemented within ZM, because even if you specify some user within zm.conf, the permissions on the program files and directories are reset to www-data when an update is applied.
Which is a real pain, when you have ZM instances, and they stop working during the night the software is updated.

With my experience, I've created a list of files/directories to set permissions onto, like /var/cache/zoneminder, or /tmp/zm, but i have to manually correct the permissions on all the servers i manage.

The ownership should be based on the configuration file, or at least well documented for beginners, even more because the logs are quite laconic.
FAT Can't connect: Permission denied zmdc.pl
FAT Can't bind: Permission denied

OK, which file are we talking about ... ?

As I said, the latest version (1.27.0) is even worse, because the www-data is hard coded within the /etc/init.d/zoneminder script. It totally breaks the service if ZM_WEB_USER is specified and different from www-data ...
start() {
echo -n "Starting $prog: "
mkdir -p $RUNDIR && chown www-data:www-data $RUNDIR
mkdir -p $TMPDIR && chown www-data:www-data $TMPDIR
$command start
RETVAL=$?
[ $RETVAL = 0 ] && echo success
[ $RETVAL != 0 ] && echo failure
echo
[ $RETVAL = 0 ] && touch /var/lock/zm
return $RETVAL
}

Can you please correct the specified bug, and pay special attention to the ZM_WEB_USER and ZM_WEB_GROUP implementation ?

Thanks =)

MilonZ
User avatar
knight-of-ni
Posts: 2404
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: Zoneminder 1.27.0

Post by knight-of-ni »

Based on the clues in your message, I am making an assumption that you are using Ubuntu and you have installed zoneminder from deb package. My answer may differ if this assumption is not correct.

For better or worse, Ubuntu has taken the coolaid like all the other Linux distros, and is moving to systemd, starting with Ubuntu 14.10.
We just added support for systemd to master, which should show up in the next version of zoneminder.

This affects your question because, starting with Ubuntu 14.10, the init script is going to look nothing like what you have now:
https://github.com/ZoneMinder/ZoneMinde ... service.in

This is a generic template, and it is up to the ubuntu package maintainer to use it as is or change it.

If you want to be more proactive about this, then I recommend you create an issue on github.
https://github.com/ZoneMinder/ZoneMinder/issues

The init script you are using is specific to ubuntu/debian and you are more likely to get the attenching of the package maintainer by creating an issue on github. The init script (the one I maintain) for rhel/centos does not make use of the apache user inside the script.

Hey, it's quitting time.... gotta run
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/
Locked