1.28.0 on opensuse 13.2 problems

Forum for questions and support relating to the 1.28.x releases only.
Locked
jfm
Posts: 46
Joined: Tue Mar 29, 2005 9:30 pm

1.28.0 on opensuse 13.2 problems

Post by jfm »

I have had zm running on different versions of suse/opensuse for the last 8 years or so, and recently decided it was time to upgrade from opensuse 12.x to 13.2.

I first tried it on a virtuall machine running opensuse 13.1 and got zm 1.26.5 to run there.
Then I Installed zm 1.27.0 on my dedicated Zoneminder server and got it running perfectly.
Then I upgraded zm to 1.28.0 and it sort of runs. All cameras captures video, alarm events works as before, filters works, viewing events works, generating videos from events works and even email notifications works.
But the "main" webpage does not recognise that zm is running. Says "Stopped", and I can not select a camera to view live stream on.
I notice that the pid file in/var/run/zm is missing, and the startup of the service fails (even if most or all "components" of zm is running)

Code: Select all


server1:~ # service zoneminder start
Job for zoneminder.service failed. See "systemctl status zoneminder.service" and "journalctl -xn" for details.
server1:~ # systemctl status zoneminder.service
zoneminder.service - Video security and surveillance system
   Loaded: loaded (/usr/lib/systemd/system/zoneminder.service; enabled)
   Active: failed (Result: exit-code) since Sun 2014-11-16 00:30:03 CET; 12s ago
  Process: 8786 ExecStart=/usr/local/bin/zmpkg.pl start (code=exited, status=1/FAILURE)

Nov 16 00:30:03 server1 zmpkg[8786]: INF [Command: start]
Nov 16 00:30:03 server1 sudo[8790]: root : TTY=unknown ; PWD=/srv/www/htdocs/zm ; USER=wwwrun ; COMMAND=/usr/bin/true
Nov 16 00:30:03 server1 sudo[8790]: pam_unix(sudo:session): session opened for user wwwrun by (uid=0)
Nov 16 00:30:03 server1 sudo[8793]: root : TTY=unknown ; PWD=/srv/www/htdocs/zm ; USER=wwwrun ; COMMAND=/usr/local/bin/zmdc.pl check
Nov 16 00:30:03 server1 sudo[8793]: pam_unix(sudo:session): session opened for user wwwrun by (uid=0)

server1:~ # ps -ef | grep zm
root      8746  4378  0 00:29 pts/1    00:00:00 grep --color=auto zm
wwwrun   19303     1  0 Nov15 ?        00:00:02 /usr/bin/perl -wT /usr/local/bin/zmdc.pl startup
wwwrun   19331 19303  0 Nov15 ?        00:00:25 /usr/local/bin/zmc -m 2
wwwrun   19332 19303  0 Nov15 ?        00:00:38 /usr/local/bin/zma -m 2
wwwrun   19340 19303  0 Nov15 ?        00:00:17 /usr/local/bin/zmc -m 3
wwwrun   19341 19303  0 Nov15 ?        00:00:43 /usr/local/bin/zma -m 3
wwwrun   19353 19303  3 Nov15 ?        00:03:01 /usr/local/bin/zmc -m 6
wwwrun   19359 19303  6 Nov15 ?        00:05:28 /usr/local/bin/zma -m 6
wwwrun   19366 19303  2 Nov15 ?        00:01:49 /usr/local/bin/zmc -m 7
wwwrun   19373 19303  6 Nov15 ?        00:05:38 /usr/local/bin/zma -m 7
wwwrun   19380 19303  0 Nov15 ?        00:00:12 /usr/local/bin/zmc -m 8
wwwrun   19381 19303  0 Nov15 ?        00:00:38 /usr/local/bin/zma -m 8
wwwrun   19391 19303  0 Nov15 ?        00:00:00 /usr/bin/perl -wT /usr/local/bin/zmaudit.pl -c
wwwrun   19398 19303  0 Nov15 ?        00:00:01 /usr/bin/perl -wT /usr/local/bin/zmwatch.pl
wwwrun   20995 19303  0 Nov15 ?        00:00:01 /usr/bin/perl -wT /usr/local/bin/zmfilter.pl

Executing "service zoneminder stop" gives no error messages. And it does not stop the above zm processes...

The startup service looks like this

Code: Select all


[Unit]
Description=Video security and surveillance system
After=mysqld.service

[Service]
Type=forking
ExecStart=/usr/local/bin/zmpkg.pl start
ExecStop=/usr/local/bin/zmpkg.pl stop
ExecReload=/usr/local/bin/zmpkg.pl reload
PIDFile=/var/run/zm/zm.pid

[Install]
WantedBy=multi-user.target

It seems like the zmpkg.pl script manages to start services, but fails to create pid file. I have looked at all logs that I think might be relevant, but can't find anything interesting or enlightening.... I am lost for ideas on where to look for useful errormessages...
jfm
Posts: 46
Joined: Tue Mar 29, 2005 9:30 pm

Re: 1.28.0 on opensuse 13.2 problems

Post by jfm »

I sort of solved it. All seems to be working now except for that "service start zoneminder" says it failed even if everything actually IS running. As zmdc.pl status is telling:

Code: Select all

server1:~ # zmdc.pl status
'zmc -m 3' running since 14/11/16 12:55:00, pid = 19812, valid
'zmc -m 7' running since 14/11/16 12:55:01, pid = 19842, valid
'zma -m 6' running since 14/11/16 12:55:07, pid = 19872, valid
'zma -m 7' running since 14/11/16 12:55:01, pid = 19843, valid
'zmwatch.pl' running since 14/11/16 12:55:03, pid = 19866, valid
'zma -m 3' running since 14/11/16 12:55:00, pid = 19819, valid
'zmaudit.pl -c' running since 14/11/16 12:55:03, pid = 19862, valid
'zma -m 2' running since 14/11/16 12:54:59, pid = 19801, valid
'zmc -m 2' running since 14/11/16 12:54:59, pid = 19800, valid
'zmc -m 6' running since 14/11/16 12:55:01, pid = 19840, valid
'zmfilter.pl' running since 14/11/16 12:55:03, pid = 19859, valid
'zma -m 8' running since 14/11/16 12:55:02, pid = 19853, valid
'zmc -m 8' running since 14/11/16 12:55:02, pid = 19852, valid
And there are lots of informational log entries in zoneminers log, and not a single warning or error since the startup!

What I've done:
I located all places where the pid file is configured or used. Some of these places was within some of the perl scripts and "hardcoded" to /var/run/zm/zm.pid. I then looked at the opensuse instructions under distros/. There is a note about altering some directory paths, including rundir, directly in the database. It says use /var/run/zoneminder as path. This would be to comply with the provided zoneminder.services configuration, and probably would work with the package from the repo. Howevere, with my installation buildt from source that would not work because some scripts are "hardcoded" to use /var/run/zm. So i changed it to be /avr/run/zm in both the database and in the zoneminder.service file. That seems to have fixed all problems with starting it except for systemctl belives it is not starting properly....

I still have to look into some config like temp_dir and content_dir, as these also seems to be "distro" spesific... It works where they are pointed now, but not sure if I like where they are pointed 8)

But, does anyone have a clue why systemctl does not "get it right"?
dubak
Posts: 3
Joined: Sun Nov 16, 2014 3:31 pm

Re: 1.28.0 on opensuse 13.2 problems

Post by dubak »

Hi,
could you please let me know how you've installed Zoneminder under OpenSuse 13.2?
I've tried to build it from source, but didn't manage to make it run. The build was done OK, but once I start apache, I just get a blank page and nothing else :-( This really drives me crazy, I've tried everything possible.
Is there any repository / rpm for Zoneminder (any version) and OpenSuse 13.2?
I've found only the one for OpenSuse 13.1 under the repository liquid-co.de
jfm
Posts: 46
Joined: Tue Mar 29, 2005 9:30 pm

Re: 1.28.0 on opensuse 13.2 problems

Post by jfm »

I just download latest version from the git repo (wget https://github.com/ZoneMinder/ZoneMinde ... 8.0.tar.gz)

and extracted it. In the source folder there is a distros/opensuse/ folder with instructions and all the information you need to install zm 1.27.0 on opensuse 13.1 from repo. There are also CMakelists.txt and a zoneminder.cmake.OS13.spec file that I think would be usefull for installing zm 1.28.0 on opensuse 13.2. I did not use that information. I used the cmakecacheimport.sh on my exsisting zm.conf. Then "cmake -C zm_conf.cmake ." and just resolved all dependencies one by one until all dependencies were met.

After that there were some error messages in the zoneminder log that indicated that i needed to install a couple of more libraries. I don't remember which though, but show me the error messages you get and I will find it :wink: (There were a couple of perl modules not in the repos, so I hade to install using cpan).

Ah, just found one thing I did. I had this error message:
"Net::SFTP::Foreign::debug" used only once: possible typo at /usr/bin/zmfilter.pl line 812.

I edited the /usr/bin/zmfilter.pl and changed the "Net::SFTP::Foreign::debug" to "Net::SFTP::Foreign". Looking at the code, it made sens that this could be a "typo". At least zmfilter.pl has been running just fine after that change. Also, looking at the perl module "Net::SFTP::Foreign", there was no reference to "Net::SFTP::Foreign::debug". Nice if someone could confirm that what I did was right...
User avatar
knight-of-ni
Posts: 2406
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: 1.28.0 on opensuse 13.2 problems

Post by knight-of-ni »

Many distros, including OS13, have started using private, tmpfs folders for /tmp that reside in memory rather than a traditional folder on your local disk.
This causes problems with zoneminder. Specifically, systemd and the web ui can disagree on the running/stopped status.

We changed the default ZM_TMPDIR from /tmp to /var/tmp to avoid this. However, it looks like you used a cmake cache file from a previous build, which means zoneminder was built with the old values of that build instead of the new. You should rebuild zoneminder, but don't use that cache file.

An easy way to build zoneminder on OS13 is to pass the ZM_TARGET_DISTRO flag like so:

Code: Select all

cmake -DZM_TARGET_DISTRO="OS13" .
It sets several parameters that are known to work on your distro and comply with Opensuse guidelines.

Lastly, the values in question only appear hardcoded. They are actually make macros that get set during the build. So if you see a "hardcoded" path that is not correct, that probably means you need to specify that value at build time.
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/
jfm
Posts: 46
Joined: Tue Mar 29, 2005 9:30 pm

Re: 1.28.0 on opensuse 13.2 problems

Post by jfm »

Hi, knnniggett, thanks. That was usefull information. I suspected that the "hardcoded" paths were not really hardcoded. Thats why I wrote "hardcoded" in hyphens... I will try to rebuild with your instructions when I get some time, probably next weekend. At least I probably have all dependencies in place so it should build quite quickly...

Do you have any comments on the "Net::SFTP::Foreign::debug" issue in zmfilter.pl?

/Jorn
dubak
Posts: 3
Joined: Sun Nov 16, 2014 3:31 pm

Re: 1.28.0 on opensuse 13.2 problems

Post by dubak »

Hi,
ist there any chance that there will be also tha package for the Zoneminder 1.28 MP (with mjpeg support) available in the repository ,as it has been done for the versions up to 1.27 for OpenSUSE up to 13.1 here: in liquid-co.de/pub/suse/repositories ???

I've tried the build several times on my own, but even if everything compiles well, I still don't get the apache, sql and zoneminder to run clean :-(
The repo would be a big help.
Locked