bertok / pygooglevoice

Automatically exported from code.google.com/p/pygooglevoice
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

asterisk tries to read .gvoice from /root directory #24

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. install pygooglevoice .5
2. add this line to /etc/asterisk/extension_custom.conf after the line that
calls gvoice

exten => _X.,n,Verbose(0,$[SYSTEMSTATUS_is_${SYSTEMSTATUS}])

3.kill asterisk and run in verbose mode to screen

/usr/sbin/asterisk -f -U asterisk -G asterisk -vvvg -c

What is the expected output? What do you see instead?

gvoice should take a few seconds and then perform the call setup steps,
however gvoice ends instantly and I see the below error:

Traceback (most recent call last):
  File "/usr/bin/gvoice", line 5, in <module>
    pkg_resources.run_script('pygooglevoice==0.5', 'gvoice')
  File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 448, in
run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 1173, in
run_script
    exec script_code in namespace, namespace
  File
"/usr/lib/python2.6/site-packages/pygooglevoice-0.5-py2.6.egg/EGG-INFO/scripts/g
voice",
line 5, in <module>
    pkg_resources.run_script('pygooglevoice==0.5', 'gvoice')
  File "build/bdist.linux-x86_64/egg/googlevoice/__init__.py", line 17, in
<module>

  File "build/bdist.linux-x86_64/egg/googlevoice/voice.py", line 1, in <module>
  File "build/bdist.linux-x86_64/egg/googlevoice/conf.py", line 49, in <module>
  File "build/bdist.linux-x86_64/egg/googlevoice/conf.py", line 15, in __init__
IOError: [Errno 13] Permission denied: '/root/.gvoice'
    -- Executing [6517467302@gv-outbound:8]
Verbose("Local/6517467302@gv-outbound-9a94;2",
"0,SYSTEMSTATUS_is_APPERROR") in new stack
SYSTEMSTATUS_is_APPERROR

What version of the product are you using? On what operating system?
asterisk 1.6.1.10
freepbx 2.6
fedora 11

Please provide any additional information below.
I have verified there is a .gvoice file with the needed items in
/var/lib/asterisk  However, it wants to run gvoice as root apparently, even
though asterisk is running as the user asterisk.

asterisk  8681  4.0  1.1 1005212 16948 pts/1   Sl   15:36   0:00
/usr/sbin/asterisk -f -U asterisk -G asterisk -vvvg -c
asterisk  8731  0.0  0.0  91832   540 ?        S    15:36   0:00 bash -c cd
/var/www/html/panel && /var/www/html/panel/safe_opserver &
asterisk  8732  0.0  0.0  91828  1180 ?        S    15:36   0:00 sh
/var/www/html/panel/safe_opserver
asterisk  8734  6.8  0.9 128748 14736 ?        S    15:36   0:00
/usr/bin/perl /var/www/html/panel/op_server.pl

Original issue reported on code.google.com by jason.ho...@gmail.com on 7 Dec 2009 at 9:36

GoogleCodeExporter commented 9 years ago
Also, if I am reading the documentation/help correctly, it should not try to 
read the
.gvoice if you provide the credentials to the gvoice command, so I'm not sure 
why it
is trying to read the .gvoice file.

Thanks.

Original comment by jason.ho...@gmail.com on 7 Dec 2009 at 9:37

GoogleCodeExporter commented 9 years ago
Asterisk must be trying to run the script as root, there is no other reason. 
Maybe it
runs the asterisk service itself as its own user, but any shell commands it 
tries to
execute it runs as root? Originally the goal was to read the conf but only use 
the
data if it was not passed. Now I have fixed it to not try and read the conf 
first b4
making a decision about passed arguments. Please follow these steps to update 
your
version:

sudo rm -rf /usr/lib/python2.6/site-packages/pygooglevoice-0.5-py2.6.egg
sudo easy_install -U -a pygooglevoice

Original comment by justquick on 8 Dec 2009 at 4:55

GoogleCodeExporter commented 9 years ago
Thank you.  It is working properly now =)

Original comment by jason.ho...@gmail.com on 9 Dec 2009 at 1:11

GoogleCodeExporter commented 9 years ago
vnotification emails. So, please do not post "+1 Me too!".
Instead, click the star icon.

Original comment by saurabhj...@gmail.com on 11 Mar 2010 at 5:00