abi wrote:I see, but I'd prefer to override them.
1. ZM_WEBDIR should point to /usr/local/www/zoneminder
It's all fine and good if you are building your own local copy of ZoneMinder. Feel free to put things where you please. However, if you create something that is intended to be distributed to others, you need to follow a standard, rather than makeup folder names that suit you personal preference. Imagine if every application in FreeBSD ports did that.
When choosing destination folders, a good place to start is the Filesystem Hierarchy Standard:
https://en.wikipedia.org/wiki/Filesyste ... y_Standard
Architecture independent shared data, belongs under /usr/share/{application}, but if we look at the exceptions below the table, we can see that FreeBSD makes an exception for its ports collection. So for the case of FreeBSD, the folder becomes /usr/local/share/{application} .
abi wrote:
2. Are there any reasons to keep zms not in /usr/local/www/zoneminder/cgi-bin?
The best place to put zms is into its own cgi-bin folder, which should be here: /usr/local/libexec/zoneminder/cgi-bin
See the hierarchy standard previously referenced and also the FreeBSD handbook (
https://www.freebsd.org/doc/handbook/dirstructure.html) for a definition of the "libexec" folder.
Alternatively, you could place it into the default cgi-bin folder defined by your webserver, but that is not optimal. That folder might not be the same for all web severs. Typically it is good idea to keep files from different applications or ports in separate folders.
abi wrote:
3. ZM_CONTENTDIR from my point of view should point to directory relative to ZM_WEBDIR, but if images and events MUST be in ZM_WEBDIR, I think just to create them there without any symlinks.
No, the files should not reside under the webdir, because those files are generated by the application, and there is spot for generated files elsewhere in the filesystem, per the standards previously mentioned.
Also note that, in a future version of ZoneMinder, no generated files will be directly accessible from zoneminder's webdir. Storing files under the webdir is a known security risk, which is why we plan to change it. You will save yourself future work if you follow the same steps all the other distros have taken by storing the files under /usr/local/var/lib/zoneminder (CONTENTDIR) and symlink the folder into the webdir. That way you simply remove the symlinks in the future version of zoneminder.
abi wrote:
What do you think about /dev/shm ? Disable it entirely or make notice to put directory under tmpfs?
On Linux /dev/shm is simply a tmpfs with a virtual device name. For FreeBSD, you should use a tmpfs as well. I'm looking at the FreeBSD 10.2 vm I recently created and it does not already have a tmpfs setup so it looks like you might have to do some work there to get one going for ZoneMinder.
abi wrote:
Also, is polkit nesessary? I see rules are used for systemctl script. Looks like it's related to systemd....
Polkit is needed in a systemd environment in order to allow ZoneMinder to restart itself from the web console without causing problems. ZoneMinder autodetects if init or systemd is running so you don't have to patch the source to get it to work.
To answer the question of whether or not you need polkit, you need to know the answer to the following. Can one restart zoneminder from the web console without pissing off the init daemon. Sys v init does not care, systemd will mark the application as crashed and cause subsequent start/restart problems, and I don't know what launchd does.
To find out, with zoneminder running, restart if from the command line exactly like so:
It should appear to restart. Now go query the init daemon to see what it thinks is the status:
I think that is how one checks on FreeBSd. Provided the status is good, then you don't need polkit.