New install on Rocky Linux fails (multiple errors) following RedHat instructions
Posted: Fri Nov 05, 2021 4:27 pm
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.
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.