ZoneMinder on OpenSuSE issues, need help!

Discussions related to the 1.36.x series of ZoneMinder
Post Reply
EveningDarkstar
Posts: 19
Joined: Tue Sep 10, 2019 11:08 pm

ZoneMinder on OpenSuSE issues, need help!

Post by EveningDarkstar »

I have been struggling (and making progress) on installing ZM 1.36 on an OpenSuSE 15.4 system. I got my copy from a community maintained repo for OpenSuSE and strongly suspect that there were/are problems with how the integrators set up ZM. I could provide a list of problems I found and had to find a fix for, if interested.

I have managed to get ZM to come up, and even display images from my cameras, but only for a short period of time. ZM will suddenly stop (mostly when viewing a live stream from a camera, but not always.) and return to the login page. A couple of observations I have noted, from the log files -

The first odd thing I see is that the apache-error.log file is constantly reporting (every few seconds while I am logged in and using ZM) "Login successful ..." messages. This indicates that behind the scene, ZM is having troubles keeping me logged in, and apparently it's attempts to keep me logged in eventually soon fails, causing ZM to log me out, and dumps me back to the manual login screen.

Code: Select all

tail -f apache-error.log
Sat Jan 07 15:45:27.308437 2023] [php7:notice] [pid 17107] [client 127.0.0.1:50752] INF [Login successful for user "Marc"], referer: http://localhost/zm/index.php?view=console
[Sat Jan 07 15:45:32.343346 2023] [php7:notice] [pid 17107] [client 127.0.0.1:50752] INF [Login successful for user "Marc"], referer: http://localhost/zm/index.php?view=console
[Sat Jan 07 15:45:37.330665 2023] [php7:notice] [pid 17107] [client 127.0.0.1:50752] INF [Login successful for user "Marc"], referer: http://localhost/zm/index.php?view=console
[Sat Jan 07 15:45:42.310539 2023] [php7:notice] [pid 17107] [client 127.0.0.1:50752] INF [Login successful for user "Marc"], referer: http://localhost/zm/index.php?view=console
[Sat Jan 07 15:45:47.331616 2023] [php7:notice] [pid 17107] [client 127.0.0.1:50752] INF [Login successful for user "Marc"], referer: http://localhost/zm/index.php?view=console
[Sat Jan 07 15:45:52.308826 2023] [php7:notice] [pid 17107] [client 127.0.0.1:50752] INF [Login successful for user "Marc"], referer: http://localhost/zm/index.php?view=console
[Sat Jan 07 15:45:57.339437 2023] [php7:notice] [pid 7657] [client 127.0.0.1:52174] INF [Login successful for user "Marc"], referer: http://localhost/zm/index.php?view=console
Also in the apache-error.log file I am seeing a lot of this error, for which I do not have a solution yet. I have not found where I could get the file wp-login.php -

Code: Select all

apache-error.log:[Wed Jan 04 13:53:56.941447 2023] [php7:error] [pid 21536] [client 130.61.143.194:46276] script '/usr/share/zoneminder/www/wp-login.php' not found or unable to stat
The second thing of concern to me is that the zm service itself terminates quickly after starting it up. It seems to last long enough to spawn a lot of sub-processes -

Code: Select all

nova:/var/log/zm # systemctl stop zm
nova:/var/log/zm # systemctl start zm
Job for zm.service failed because the control process exited with error code.
See "systemctl status zm.service" and "journalctl -xeu zm.service" for details.

nova:/var/log/zm # systemctl status zm
× zm.service - ZoneMinder Video Surveillance System
Loaded: loaded (/usr/lib/systemd/system/zm.service; disabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Sat 2023-01-07 16:30:31 PST; 11s ago
Process: 26983 ExecStartPre=/usr/bin/zm_database_init --non-interactive (code=exited, status=0/SUCCESS)
Process: 26984 ExecStart=/usr/bin/zmpkg.pl start (code=exited, status=1/FAILURE)

Jan 07 16:30:31 nova zmpkg[26984]: INF [Command: start]
Jan 07 16:30:31 nova sudo[26990]:     root : PWD=/usr/share/zoneminder/www ; USER=wwwrun ; COMMAND=/usr/bin/true
Jan 07 16:30:31 nova sudo[26992]:     root : PWD=/usr/share/zoneminder/www ; USER=wwwrun ; COMMAND=/usr/bin/zmdc.pl check
Jan 07 16:30:31 nova systemd[1]: zm.service: Control process exited, code=exited, status=1/FAILURE
Jan 07 16:30:31 nova systemd[1]: zm.service: Failed with result 'exit-code'.
Jan 07 16:30:31 nova systemd[1]: Failed to start ZoneMinder Video Surveillance System.
I have not found a real reason why zm.service is failing to start other than it appears (from looking at the code in zmpkg.pl) that neither stopping or restarting the zm service changes the state from "RUNNING". And because zmpkg.pl thinks the zm service is already running, it reports an error when
it tries to start the zm service again.

ASIDE NOTE: zmpkg.pl is dropping the reason for returning an error (Already running), into the bit bucket. This is bad programming practice, it should be logged at least, better yet reported to the user visually.

The following shows that even though zm.service failed to start, it at least spawned off a lot of child processes before failing.

Code: Select all

nova:/var/log/zm # ps aux | grep zm | grep -v emacs | grep -v grep
wwwrun    6229 18.1  0.5 573780 95444 ?        Sl   Jan06 426:50 /usr/bin/zmc -m 9
wwwrun    6491 18.2  0.5 573788 96556 ?        Sl   Jan06 429:03 /usr/bin/zmc -m 8
wwwrun   17138  8.9  0.6 574704 98880 ?        Sl   10:25  32:24 /usr/bin/zmc -m 10
wwwrun   17143  1.5  0.2 551352 46968 ?        Sl   10:25   5:44 /usr/bin/zmc -m 2
wwwrun   17155  2.9  0.3 551904 52064 ?        Sl   10:25  10:30 /usr/bin/zmc -m 11
wwwrun   18258  2.7  0.3 551384 50804 ?        Sl   15:21   1:50 /usr/bin/zmc -m 3
wwwrun   20189  0.0  0.0  78816 15768 ?        S    Jan01   5:03 /usr/bin/perl -wT /usr/bin/zmdc.pl startup
wwwrun   20293  0.0  0.3 125844 58140 ?        S    Jan01   0:35 /usr/bin/perl -wT /usr/bin/zmfilter.pl --filter_id=1 --daemon
wwwrun   20299  0.0  0.4 134316 66496 ?        S    Jan01   0:07 /usr/bin/perl -wT /usr/bin/zmfilter.pl --filter_id=2 --daemon
wwwrun   20305  0.0  0.5 149572 81320 ?        S    Jan01   0:10 /usr/bin/perl -wT /usr/bin/zmfilter.pl --filter_id=3 --daemon
wwwrun   20311  3.0  1.1 251680 185584 ?       S    Jan01 269:03 /usr/bin/perl -wT /usr/bin/zmaudit.pl -c
wwwrun   20317  0.0  0.1  76172 18396 ?        S    Jan01   2:52 /usr/bin/perl -wT /usr/bin/zmwatch.pl
wwwrun   20324  0.0  0.1 100656 32252 ?        S    Jan01   0:00 /usr/bin/perl -wT /usr/bin/zmupdate.pl -c
wwwrun   20329  0.0  0.0 111688  7072 ?        S    Jan01   0:00 /usr/bin/perl -wT /usr/bin/zmtelemetry.pl
wwwrun   20337  0.0  0.0  75960 15084 ?        S    Jan01   0:02 /usr/bin/perl -wT /usr/bin/zmstats.pl
wwwrun   25975  8.7  0.6 581776 107264 ?       Sl   16:22   0:24 /usr/bin/zmc -m 5
wwwrun   26020 11.8  0.5 573560 94056 ?        Sl   16:23   0:31 /usr/bin/zmc -m 6
wwwrun   26176  9.3  0.5 573840 87832 ?        Sl   16:24   0:17 /usr/bin/zmc -m 4
wwwrun   26575  0.8  0.3 424688 52204 ?        Sl   16:27   0:00 /usr/bin/zmc -m 1
wwwrun   26586  3.1  0.3 424688 52144 ?        Sl   16:27   0:00 /usr/bin/zmc -m 12
Any ideas on how to get the zm.service and ZoneMinder's gui to run reliably? Much appreciate any and all offers of help, thanks in advance....

Marc..

P.S. It is very aggravating to spend time writing up a complex email, such as this one, only to find that the web server has timed you out, forces you to re-log in, and then drops everything you had typed up, on the floor. The one thing I remember most, from my computer science classes many many years ago, is that the first cardinal rule of good programming practices, is to NEVER NEVER NEVER lose user data! This web interface badly violates that rule!
Magic919
Posts: 1381
Joined: Wed Sep 18, 2013 6:56 am

Re: ZoneMinder on OpenSuSE issues, need help!

Post by Magic919 »

I especially like the bit where you want to ‘find’ the file that hackers keep looking for.
-
EveningDarkstar
Posts: 19
Joined: Tue Sep 10, 2019 11:08 pm

Re: ZoneMinder on OpenSuSE issues, need help!

Post by EveningDarkstar »

LOL! It took me awhile to grok what you were trying to say Magic919, I am not familiar with wp-login.php files, not a Word Press user and didn't know that this is the name of the standard login script for Word Press sites. So just was reporting anomalies that I am seeing. OK I will knock that one off my list of things to worry about, and set my grep and fail2ban filters accordingly. The rest of my issues, that I reported still stand and I am in need of help/solutions. Thanks for your input... Marc
Magic919
Posts: 1381
Joined: Wed Sep 18, 2013 6:56 am

Re: ZoneMinder on OpenSuSE issues, need help!

Post by Magic919 »

You already had a response from Isaac on your previous thread.

Either use an OS with a known good package or wait for Isaac.
-
EveningDarkstar
Posts: 19
Joined: Tue Sep 10, 2019 11:08 pm

Re: ZoneMinder on OpenSuSE issues, need help!

Post by EveningDarkstar »

Magic919 - Granted. I started a new thread for a couple of reasons, I have gotten past the ZM_PATH_SOCKS issue that Isaac helped me with, and I have managed to make progress on getting ZM up and running under OpenSuSE. Since I am at a new roadblock I thought I would report my current state and see if anyone could help me with (perhaps have experienced and found solutions for) the new errors I am seeing.

Asking me to switch to a different OS is a bit extreme. It would require a lot of effort to grok an different variant of Linux, and then switch all the other dependencies of programs and services I am running, into the new environment. I know Isaac means well when he offered to take a look at OpenSuSE but I also know that he will also have to grok a lot about a different Linux environment, one that he is not use to. So I am reporting my progress, and will continue to study and look for solutions on my own as well. I think it is the best use of my time to keep searching for answers, asking new questions, etc while Isaac, you and perhaps others can help me achieve my goal of getting ZM running properly under OpenSuSE. I appreciate Isaac is planning to explore one path, if he gets the spare time cycles to do so, in the meantime there are other paths for me to explore also. Thank you for your thoughts, Marc...
Magic919
Posts: 1381
Joined: Wed Sep 18, 2013 6:56 am

Re: ZoneMinder on OpenSuSE issues, need help!

Post by Magic919 »

If you don't mind spending your time on it, fair enough.

I'd suggest you look at running it manually, on the commandline, rather than as a service. Might reveal useful clues.

Hopefully it's the current version and you are not hitting bugs that have been fixed.
-
User avatar
iconnor
Posts: 3329
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: ZoneMinder on OpenSuSE issues, need help!

Post by iconnor »

The wp-login thing as you know is someone hitting your site and scanning it for vulnerabilities.

The logout problem I suspect is due to inconsistency between the time zone set at the system level (hence mysql level), and what is set in php. System and php have to agree about the time zone, or else login sessions expire either immediately or after an hour or whatever.
EveningDarkstar
Posts: 19
Joined: Tue Sep 10, 2019 11:08 pm

Re: ZoneMinder on OpenSuSE issues, need help!

Post by EveningDarkstar »

Thanks iconnor for taking the time to read and respond to my request for help, much appreciated!

As for time zone settings, the file /etc/php7/apache2/php.ini has the following definition

Code: Select all

[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
; date.timezone = 'UTC'
date.timezone = 'America/Los_Angeles'
and timedatectl shows -

Code: Select all

# timedatectl
Local time: Tue 2023-01-10 16:12:17 PST
Universal time: Wed 2023-01-11 00:12:17 UTC
RTC time: Wed 2023-01-11 00:12:17
Time zone: America/Los_Angeles (PST, -0800)
System clock synchronized: yes
NTP service: active
RTC in local TZ: no
It appears to me that these are showing PHP and my local system is using the same time zone... Marc....
Post Reply