For those that don’t know, ZoneMinder is a (surveillance) video management system. It
takes video streams from surveillance cameras, and stores the video files to designated
storage locations. It also stores metadata related to each video event into a backend dB.
Since the underlying daemons run as the web account user, the locations ZoneMinder writes
to must be owned by that same user account.
As the package maintainer and upstream developer for the ZoneMinder project, one of the
items on my to-do list has been to figure out a way to make the ZoneMinder package distro
agnostic.
On RedHat, ZoneMinder is traditionally built against Apache, but I’ve written the specfile
such that, today, one can build against nginx by changing the web user & group name
globals found at the top of the specfile. This of course works fine for a single offline
user who knows how to roll their own package.
However, I have yet to come up with a sensible solution that works for a hosted
repository.
Here are the problems as I see them:
- files & folders that must be owned by the web account user
- files with with the same name, but different content, depending on what webserver is
being used
- The web account user is inserted in zm.conf, the systemd unit file, and tmpfiles.d
config during build via make macro.
Here are possible solutions I have looked into, but don’t particularly care for:
- Multiple buildroots within the same specfile. This sounds like total insanity to me.
- Use of sed in %post to split ZoneMinder into subpackages each with content specific to
each supported web server. This sounds very hackish, and I’m not sure if if can be done
w/o multiple buildroots
- Being part of upstream, I do have “hidden option C” available to me. I could update
ZoneMinder zmupdate.pl script to allow the end user to arbitrarily change the web account
user after the fact e.g. “zmupdate.pl –web_user nginx”. The downside to this approach is
that is significantly widens the scope to include all users running ZoneMinder, including
those using on obscure distros with weird filesystem structures.
I maintain the specfile on the ZoneMinder github site, which you can view here:
https://github.com/ZoneMinder/zoneminder/blob/master/distros/redhat/zonem...
If anyone knows of an existing package that has overcome a similar problem, please point
me to it.
I don’t want to make the opening arguments of this message too long, so I’ll stop here and
wait for follow up questions and comments.