Page 1 of 1

Status 2 error on Filter

Posted: Sat Apr 02, 2016 3:22 pm
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

Re: Status 2 error on Filter

Posted: Sat Apr 02, 2016 5:58 pm
by bbunge

Re: Status 2 error on Filter

Posted: Sun Apr 03, 2016 1:11 am
by rwreed
Ok, followed those instructions but still have the same error.

Other ideas?
Thanks so much
Randy

Re: Status 2 error on Filter

Posted: Mon Apr 04, 2016 3:01 pm
by iconnor
Um.. I wonder if 2 is the return code from the play command.
Maybe try sticking an exit at the end.

Re: Status 2 error on Filter

Posted: Mon Apr 04, 2016 5:31 pm
by asker
Does it play the sound successfully ? If not try putting in the full path of play in the script

Re: Status 2 error on Filter

Posted: Mon Apr 04, 2016 6:01 pm
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