New install on Rocky Linux fails (multiple errors) following RedHat instructions

Discussions related to the 1.36.x series of ZoneMinder
Post Reply
lpallard
Posts: 87
Joined: Fri Mar 05, 2010 10:59 pm

New install on Rocky Linux fails (multiple errors) following RedHat instructions

Post by lpallard »

Hello guys,

Following the instructions of https://zoneminder.readthedocs.io/en/st ... edhat.html I installed ZM on a brand new VM running Rocky Linux 8 (Centos 8 replacement).

Install went fine (AFAIK), it can connect to the [b]remote[/b] MariaDB database, the web UI loads perfectly and no errors in Apache logs, but I cannot start the ZM service.

Problem 1: Service startup issue

When I issue "systemctl start zoneminder" I get:

[code]Failed to start zoneminder.service: Unit mariadb.service not found.[/code]

There is [u]NO database server installed on this VM[/u] because I am using a [u]remote[/u] DB server. No need to have MySQL/MariaDB run locally, it would create just more overhead... Why is the service script trying to start the MariaDB service although /etc/zm/conf.d/zm-db-user.conf is configured to use a remote DB server? The file contains:

[code]ZM_DB_HOST=databaseserver.localdomain
ZM_DB_NAME=zmdb
ZM_DB_USER=zoneminderuser
ZM_DB_PASS=PASSWORD
[/code]

Please note that the mariadb client binaries are installed locally so the command "mysql" is available.

[b]Problem 2: Memory map issue[/b]

ZM logs shows:

[code]Can't open memory map file /dev/shm/zm.mmap.1: No such file or directory[/code]

I am not sure why, but googling this returns a handful of results. I remember a few years ago, googling the same would return results from all over the place... (What happened to google ?) I vaguely remember this has something to do with permissions or kernel parameters, but I cannot remember what it is... Need a hint on this one ;)

[b]Problem 3: Misc zms issues[/b]

ZM logs show:

[code]Socket /var/lib/zoneminder/sock/zms-911343s.sock does not exist. This file is created by zms, and since it does not exist, either zms did not run, or zms exited early. Please check your zms logs and ensure that CGI is enabled in apache and check that the PATH_ZMS is set correctly. Make sure that ZM is actually recording. If you are trying to view a live stream and the capture process (zmc) is not running then zms will exit. Please go to http://zoneminder.readthedocs.io/en/lat ... window-etc for more information.[/code]

This is probably because the zms daemon is not started? Solving the previous issues would help?

[b]README instructions[/b]

I strongly suggest adding the bold lines below to the README* file. Its obvious after the fact, but not really that these need to be specified there. To be honest I tried to connect at first only with username+password, but of course it didnt work when ZM told me that it couldnt connect to localhost DB server. Then I added the ZM_DB_HOST & ZM_DB_NAME lines and it worked.

[code]3. If you have chosen to change the zoneminder database account credentials to
something other than zmuser/zmpass, you must now create a config file under
/etc/zm/conf.d and set your credentials there. For example, create the file
/etc/zm/conf.d/zm-db-user.conf and add the following content to it:

[b] ZM_DB_HOST={hostname of the database server to use. use localhost if server runs locally, or FQDN if remote}
ZM_DB_NAME={name of the remote or local database to use}[/b]
ZM_DB_USER = {username of the sql account you want to use}
ZM_DB_PASS = {password of the sql account you want to use}


Once the file has been saved, set proper file & ownership permissions on it:

sudo chown root:apache *.conf
sudo chmod 640 *.conf
[/code]

PS: I am sorry about the tags, the forum seems to fail at parsing them, at least on my computer.
lpallard
Posts: 87
Joined: Fri Mar 05, 2010 10:59 pm

Re: New install on Rocky Linux fails (multiple errors) following RedHat instructions

Post by lpallard »

Okay here's an update:

Problem 1: Service startup issue

I installed MariaDB server locally, and the ZM service starts now. Also the service file contains:

# ZoneMinder systemd unit file for RedHat distros and clones
# See drop-in folder for additional config directives
[Unit]
Description=ZoneMinder CCTV recording and security system
After=network.target mariadb.service
Requires=mariadb.service
BindsTo=mariadb.service
[Service]
Type=forking
ExecStart=/usr/bin/zmpkg.pl start
ExecReload=/usr/bin/zmpkg.pl restart
ExecStop=/usr/bin/zmpkg.pl stop
PIDFile=/var/run/zoneminder/zm.pid
Environment=TZ=/etc/localtime
RuntimeDirectory=zoneminder
RuntimeDirectoryMode=0755
[Install]
WantedBy=multi-user.target

So I conclude that it is "hardcoded" to have MySQL/MariaDB server (not just the client binaries) installed & started on the localhost. That doesnt make sense IMO but I may (possibly) be wrong. Looking at the ZM dev's replies on this one.

Problem 2: Memory map issue

Disappeared when ZM service successfully started.

Problem 3: Misc zms issues

Disappeared when ZM service successfully started.

New issue: The logs are packed with "Cannot write to event folder /var/lib/zoneminder/events. Check that it exists and is owned by the web account user."

However, zm.conf is configured to use another path (an external HDD) for events and images storage:

ZM_DIR_EVENTS=/mnt/zoneminder-data/events
ZM_DIR_IMAGES=/mnt/zoneminder-data/images

The folder(s) are indeed filling up with ZM files so I know this works. I also added a custom storage under options:

Name: Events
Path: /mnt/zoneminder-data/events
Url: BLANK
Server: Remote/No Specific Server
Type: Local
Scheme: Medium
Do Deletes: YES
Enabled: YES

Why is ZM still trying to write to "/var/lib/zoneminder/events"? Looks like a bug to me....
Post Reply