The full path name fixed the problem with script execution. Thanks for all the help!
Jonathan ----- Original Message ----- From: "Tzafrir Cohen" <[EMAIL PROTECTED]> To: <[email protected]> Sent: March 9, 2005 9:16 AM Subject: Re: [Asterisk-Users] Asterisk System() call error > On Wed, Mar 09, 2005 at 08:37:02AM -0500, Jonathan Hobbs wrote: > > I have a linux (bash) script file which is invoked via: > > > > exten => s,3,System(./BuildMsg.sh ${SFile} msg02 msg99) > > > > Don't assume the daemon runs in a certain directory. The working > directory of a daemon should generally be '/' unless it is chrooted for > security concerns. > > So please provide the full path to the script. Anyway, scripts don't > belong in /etc/asterisk. There is enough junk there already. > > > > > When I start asterisk with the command: asterisk -vvvvgc > > > > This script executes as expected ('asterisk -gc' and 'asterisk -vg' also > > work). However, when I try to start asterisk with the command: > > 'asterisk -g' the script does not execute and I get the following error > > message in the 'messages' log file: > > > > Mar 9 08:06:55 WARNING[790]: Unable to execute './BuildMsg.sh 1-1 msg02 > > msg99' > > > > The script file is located in /etc/asterisk, and I have confirmed that > > asterisk is looking for the script file in this location: I tried > > exten => s,3,System(pwd > location.out) and location.out contained > > '/etc/asterisk'. > > So let's start ruling out reasons: > > 1. use full path > > 2. System(ls -l /path/to/BuildMsg.sh >/tmp/output) > > 3. System(strace -o /tmp/trace /path/to/BuildMsg.sh 1-1 msg02 msg99) > > > > > Asterisk is running as root and the group/owner of Buildmsg.sh are set to > > 'root' (I have also done a 'chmod 777 Buildmsg.sh' just to be sure). I am > > running: Asterisk CVS-HEAD-02/17/05-11:17:10, on a linux box with GNU bash, > > version 2.05b.0(1) > > Distro? Kernel? Glibc? > > -- > Tzafrir Cohen | New signature for new address and | VIM is > http://tzafrir.org.il | new homepage | a Mutt's > [EMAIL PROTECTED] | | best > ICQ# 16849755 | Space reserved for other protocols | friend > _______________________________________________ > Asterisk-Users mailing list > [email protected] > http://lists.digium.com/mailman/listinfo/asterisk-users > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users > _______________________________________________ Asterisk-Users mailing list [email protected] http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
