Status 2 error on Filter

Forum for questions and support relating to the 1.29.x releases only.
Locked
rwreed
Posts: 2
Joined: Sat Apr 02, 2016 3:14 pm

Status 2 error on Filter

Post by rwreed »

Hi All,

Running zoneminder 1.29.0 on Ubuntu 14.04 , used http://zoneminder.readthedocs.org/en/st ... buntu-14-x for installation.
I'm attempting a fairly simple filter script to play a sound when the alarm frames > 29. But I get the following every time.

Code: Select all

2016-04-02 11:16:58.843580	zmfilter		7688	ERR	Command '/home/randy/CatAlarmScript.sh /usr/share/zoneminder/www/events/1/16/04/01/21/12/38' exited with status: 2	zmfilter.pl	
2016-04-02 11:16:58.794370	zmfilter		7688	INF	Executing '/home/randy/CatAlarmScript.sh /usr/share/zoneminder/www/events/1/16/04/01/21/12/38'	zmfilter.pl	
The script is simple

Code: Select all

#!/bin/bash
play -q /usr/share/sounds/ubuntu/stereo/desktop-logout.ogg 
I can execute both zmfilter.pl and the script without error (in foreground and background). I have checked the group/owner and both are owned by apache (www-data). But I'm stuck. Any suggestions.
Thanks in advance.
Randy
bbunge
Posts: 2956
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: Status 2 error on Filter

Post by bbunge »

rwreed
Posts: 2
Joined: Sat Apr 02, 2016 3:14 pm

Re: Status 2 error on Filter

Post by rwreed »

Ok, followed those instructions but still have the same error.

Other ideas?
Thanks so much
Randy
User avatar
iconnor
Posts: 3282
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: Status 2 error on Filter

Post by iconnor »

Um.. I wonder if 2 is the return code from the play command.
Maybe try sticking an exit at the end.
User avatar
asker
Posts: 1553
Joined: Sun Mar 01, 2015 12:12 pm

Re: Status 2 error on Filter

Post by asker »

Does it play the sound successfully ? If not try putting in the full path of play in the script
I no longer work on zmNinja, zmeventnotification, pyzm or mlapi. I may respond on occasion based on my available time/interest.

Please read before posting:
How to set up logging properly
How to troubleshoot and report - ES
How to troubleshoot and report - zmNinja
ES docs
zmNinja docs
User avatar
knight-of-ni
Posts: 2406
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: Status 2 error on Filter

Post by knight-of-ni »

Here is the definition of exit status 2:
http://tldp.org/LDP/abs/html/exitcodes.html

You need to test the script as the web account user, www-data, not as yourself or root. You can do that from the command line with sudo.

What I would do is:
- move the script to /usr/share/zoneminder/sounds
- verify the web-account user has audio device permissions to play any audio file. In Ubuntu that might simply mean adding the web account user to the audio group
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