Arch Linux service not starting

Forum for questions and support relating to the 1.30.x releases only.
JohnnySSH
Posts: 10
Joined: Sun Jan 26, 2014 2:14 pm

Arch Linux service not starting

Post by JohnnySSH »

Hi,

I'm trying to test ZM on Arch Linux. I wonder if anyone has managed to get version 1.30.x working on this platform in the first place?

Unfortunately as there is no package for it yet, and having tried the one from the AUR I had issues getting the API to work as I ran into the PHP7 and previous version of Cake issue....

specified by here: viewtopic.php?f=34&t=24306&start=15

What I did so far is a git pull using a little help from these guides for Ubuntu:

https://github.com/pliablepixels/zmNinj ... om-Package

https://github.com/pliablepixels/zmNinj ... rom-source

So the steps I ran were:

Code: Select all

git clone https://github.com/ZoneMinder/ZoneMinder.git
cd ZoneMinder/
git submodule init
git submodule update
cmake .
make
sudo make install
sudo ./zmlinkcontent.sh

....and then followed on from:

Code: Select all

ScriptAlias /zm/cgi-bin "/usr/local/libexec/zoneminder/cgi-bin"
<Directory "/usr/local/libexec/zoneminder/cgi-bin">
    Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
    AllowOverride All
    Require all granted
</Directory>

Alias /zm /usr/local/share/zoneminder/www
<Directory /usr/local/share/zoneminder/www>
  php_flag register_globals off
  Options Indexes FollowSymLinks
  <IfModule mod_dir.c>
    DirectoryIndex index.php
  </IfModule>
</Directory>

<Directory /usr/local/share/zoneminder/www/api>
    AllowOverride All
</Directory>
So far everything seems ok but for some reason I am unable to start the ZM service... the error I get from "journalctl -xe" is this:

Code: Select all

-- Unit zoneminder.service has begun starting up.
Jun 15 23:08:38 Zoneminder zmpkg[791]: INF [Sanity checking States table...]
Jun 15 23:08:39 Zoneminder zmpkg[791]: INF [Command: start]
Jun 15 23:08:39 Zoneminder sudo[798]:     http : unknown user: true
Jun 15 23:08:39 Zoneminder zmpkg.pl[791]: sudo: unknown user: true
Jun 15 23:08:39 Zoneminder zmpkg.pl[791]: sudo: unable to initialize policy plugin
Jun 15 23:08:39 Zoneminder su[799]: pam_unix(su:auth): auth could not identify password for [root]
Jun 15 23:08:39 Zoneminder su[799]: FAILED SU (to root) http on none
Jun 15 23:08:42 Zoneminder zmpkg.pl[791]: Password: su: Authentication information cannot be recovered
Jun 15 23:08:42 Zoneminder su[800]: pam_unix(su:auth): auth could not identify password for [root]
Jun 15 23:08:42 Zoneminder su[800]: FAILED SU (to root) http on none
Jun 15 23:08:45 Zoneminder zmpkg.pl[791]: Password: su: Authentication information cannot be recovered
Jun 15 23:08:45 Zoneminder zmpkg[791]: ERR [Unable to find valid 'su' syntax]
Jun 15 23:08:45 Zoneminder systemd[1]: zoneminder.service: Control process exited, code=exited status=255
Jun 15 23:08:45 Zoneminder systemd[1]: Failed to start ZoneMinder CCTV recording and security system.
-- Subject: Unit zoneminder.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit zoneminder.service has failed.
-- 
-- The result is failed.
Jun 15 23:08:45 Zoneminder systemd[1]: zoneminder.service: Unit entered failed state.
Jun 15 23:08:45 Zoneminder systemd[1]: zoneminder.service: Failed with result 'exit-code'.
In order to create a .service file I used the AUR versions one with slight modification:

Code: Select all

# ZoneMinder systemd unit file for Arch Linux

[Unit]
Description=ZoneMinder CCTV recording and security system
After=network.target mysqld.service httpd.service
Requires=mysqld.service httpd.service

[Service]
User=http
Type=forking
ExecStart=/usr/local/bin/zmpkg.pl start
ExecReload=/usr/local/bin/zmpkg.pl restart
ExecStop=/usr/local/bin/zmpkg.pl stop
PIDFile="/tmp/zm.pid"

[Install]
WantedBy=multi-user.target

I am not sure why the above su / sudo errors are coming up? I enabled debug logging too in the web UI:

but all I get is

Code: Select all

06/15/16 23:18:35.146016 web_php[380].DBG [LogOpts: level=DBG/DBG, screen=OFF, database=INF, logfile=DBG->/var/log/zoneminder/zm_debug.log.380, weblog=INF, syslog=INF] at /usr/local/share/zoneminder/www/includes/logger.php line 168

Would anyone be able to help figuring out the cause of the error messages in "journalctl"???

Of course I have the "http" user and it is allowed to run sudo too; all the correct dependencies should be in too as I previously had the AUR package installed before attempting a complete compile.
rockedge
Posts: 1173
Joined: Fri Apr 04, 2014 1:46 pm
Location: Connecticut,USA

Re: Arch Linux service not starting

Post by rockedge »

check if the the "zm" directory like /var/log/zm exists.
JohnnySSH
Posts: 10
Joined: Sun Jan 26, 2014 2:14 pm

Re: Arch Linux service not starting

Post by JohnnySSH »

Thanks for the response!

I have the directory /var/log/zoneminder

Also the paths in the web UI are set to use the same too.... under: LOG_PATH

It seems all is fine just the ZM service isn't able to start?
felixita
Posts: 28
Joined: Tue Feb 09, 2016 12:35 pm

Re: Arch Linux service not starting

Post by felixita »

I tried 1.30 from aur and i've "solved" Cakephp issue taking api folder from 1.29 version. The problem that i haven't solved was in zm motion detect: 9 times to 10 not work!. Although there was a motion in an allarm zon, zm e almost always not detect nothing.

For the moment i returned back to 1.29...

Bye.
JohnnySSH
Posts: 10
Joined: Sun Jan 26, 2014 2:14 pm

Re: Arch Linux service not starting

Post by JohnnySSH »

@felixita when you say you tried version 1.30 from AUR, I only packages for 1.29 under AUR site?? Is there something I am missing as package would be better then GIT build if I could get my hands on it....
felixita
Posts: 28
Joined: Tue Feb 09, 2016 12:35 pm

Re: Arch Linux service not starting

Post by felixita »

zoneminder-git (1.29.0-3) for AUR is Zoneminder 1.30.0.
JohnnySSH
Posts: 10
Joined: Sun Jan 26, 2014 2:14 pm

Re: Arch Linux service not starting

Post by JohnnySSH »

Thanks so much! :-) I thought it was still version 1.29 as it says but then if it's a git pull....

Anyway, bottom line; the package is installed now and works fine :-)
felixita
Posts: 28
Joined: Tue Feb 09, 2016 12:35 pm

Re: Arch Linux service not starting

Post by felixita »

well, but please define an active allarm zone and try if motion detect work. tnks.
JohnnySSH
Posts: 10
Joined: Sun Jan 26, 2014 2:14 pm

Re: Arch Linux service not starting

Post by JohnnySSH »

Hmm... this is strange. After restarting the ZM service the API failed to work.

I had to rebuild from Git then move the API folder to /srv/http/zoneminder <- webroot

There seemed to be some missing files??

Also the image stream didn't work so I installed Cambozola and still it didn't work, but the restart may have been the issue as it's fine now.

I am just looking at how to enable motion detection now!

[EDIT]

Motion detection seems ok!! I set it up to trigger an alarm with one of my cameras facing the TV and so far 5 events got triggered....

Low FPS though with my webcams? I have a laptop with one internal and one USB HD webcam but am only getting round 5fps?? The CPU is an i7 mobile so should be enough with 8GB RAM, I've also tried increasing the FPS rates too but they don't seem to have any effect.

Though I have set to stream mpeg and not mjpeg I can't work this one out :-(
felixita
Posts: 28
Joined: Tue Feb 09, 2016 12:35 pm

Re: Arch Linux service not starting

Post by felixita »

I've noticed that an allarm was generated only if the motion event take a great quote of allarmed area. Contrariwise, a motion event less noticeable (obviously higher than the set minimum threshold) did not generate alarms. Do many tests please...
JohnnySSH
Posts: 10
Joined: Sun Jan 26, 2014 2:14 pm

Re: Arch Linux service not starting

Post by JohnnySSH »

I have done a test like so:
Screenshot_2016-06-18_16-44-41.png
Screenshot_2016-06-18_16-44-41.png (852.53 KiB) Viewed 8536 times
where I am trying to test for the two blinking LED's at the top; possible states are: OO - OX - XO - XX <- third LED is power LED and always on so not important!

Though every second the LED's change the amount of alarms I get is quite low... It does work but the problem is either FPS related or the settings are not correct?

I have also set ZM to send Email but that doesn't seem to function, I am not sure if it can work with just "s-nail" installed alone or if I need to actually install an MTA such as Postfix?

Current alarm status is below:
Screenshot_2016-06-18_16-49-59.png
Screenshot_2016-06-18_16-49-59.png (24.42 KiB) Viewed 8536 times
JohnnySSH
Posts: 10
Joined: Sun Jan 26, 2014 2:14 pm

Re: Arch Linux service not starting

Post by JohnnySSH »

So currently I dropped the resolutions to 1/2 HD: 640x360 pixels

Defined zones now look like:
Screenshot_2016-06-18_21-56-47.png
Screenshot_2016-06-18_21-56-47.png (283.03 KiB) Viewed 8531 times
and
Screenshot_2016-06-18_21-57-25.png
Screenshot_2016-06-18_21-57-25.png (358.26 KiB) Viewed 8531 times

For the "Rack" zone the Alarm trigger is on permanently as expected since there are always flashing lights on the switches. What I am now going to do is test that the flashing lights get *ignored* but when someone walks past the Alarm triggers.

....hopefully soon I will be able to grab some IP cams too and test properly at high resolution and FPS not to mention with linking etc....
JohnnySSH
Posts: 10
Joined: Sun Jan 26, 2014 2:14 pm

Re: Arch Linux service not starting

Post by JohnnySSH »

Discovering a few errors with web viewer:

Code: Select all

Buffer passed to JPEG library is too small

Code: Select all

getStreamCmdResponse stream error: socket_sendto( /var/lib/zoneminder/sock/zms-687770s.sock ) failed: Connection refused - checkStreamForErrors()
On a new build FPS not being reported on the "live view monitor display" even though Perl modules for mem and cpu are installed?


There seems to be something strange if using an external server for database, basically I have a full on DB server and so I tried running the MySQL DB on that, when doing that even when "zm.conf" is provisioned properly to use the DB system and not "localhost" the API starts complaining that URL Rewriting is not setup properly?


Oh and last thing, not sure if this is ZM or camera but I bought an HiKvision bullet cam, the model that was suggested in the Wiki that was similar to a dome cam; anyway, ZM had been reporting FPS of 100 when the cameras maximum is 25fps?

- rebooting the camera solved this so it might have just been a small communications glitch but thought I'd pop it up here in anycase :-)

[EDIT] dome version guide: https://wiki.zoneminder.com/Hikvision_DS-2CD2332-I while bullet cam model is: DS-2CD2032-I
User avatar
knight-of-ni
Posts: 2404
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: Arch Linux service not starting

Post by knight-of-ni »

I just run into this issue myself on Fedora 24, but my build on CentOS 7 worked fine.

Guessing this might be a jpeg library issue, I rolled back my version of libjpeg-turbo from 1.5.0 to 1.4.2 and the problem immediately went away. See if you can do something similar and report back.
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/
User avatar
knight-of-ni
Posts: 2404
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: Arch Linux service not starting

Post by knight-of-ni »

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/
Locked