[asterisk-users] System() command refuses to execute bash script

Steve Edwards asterisk.org at sedwards.com
Mon Mar 2 10:01:11 CST 2015


On Mon, 2 Mar 2015, Stefan Viljoen wrote:

> So the problem was not Asterisk or BASH or permissions, but rather that 
> it appears that all paths in any System() script must be absolutely, not 
> relatively, specified.

Not quite.

The 'base' for relative paths would be the 'cwd' (current working 
directory) of the Asterisk process.

You can show the cwd for your running Asterisk by:

 	sudo ls -l /proc/$(pidof asterisk)/cwd

which is a link to the process's cwd.

I suspect if you search your file system ('sudo find / -name 
wireless-executed'), you will find 'wireless-executed' -- probably in the 
directory shown by the above command.

You can set this in the script that starts Asterisk. I set mine to /tmp/ 
('cd /tmp/') so I know where any random file access will occur, relatively 
speaking.

-- 
Thanks in advance,
-------------------------------------------------------------------------
Steve Edwards       sedwards at sedwards.com      Voice: +1-760-468-3867 PST
Newline                                              Fax: +1-760-731-3000



More information about the asterisk-users mailing list