pg_staging icon indicating copy to clipboard operation
pg_staging copied to clipboard

error while executing utils.run_client_script(host, args, use_sudo = True):

Open himanchali opened this issue 16 years ago • 4 comments

init , load commands use utils.run_client script() to run the new temp pgbouncer config file. This method uses sudo and without sudo it cant be executed.

I m getting the error while the execution comes on this method and the execution stops here. I get error :- ' [sudo] password for user ' Also, after it a link is created between the pgbouncer.ini and temprory generated pgbouncer.ini.

Pls Help.

himanchali avatar Jan 05 '10 06:01 himanchali

I'm unclear if you tested with use_sudo = False in your pg_staging.ini setup?

dimitri avatar Jan 05 '10 06:01 dimitri

The sudo issue is solved. Now the problem is in link creation between pgbouncer.ini and temp pgbouncer.ini. i 've done some modification in staging_client.sh. #filename=basename $1 filename=$1

#mv $1 $PGBOUNCER_BASEDIR/$filename
#chmod a+r $PGBOUNCER_BASEDIR/$filename
chmod a+r $filename

U were moving the pgbouncer.temp.ini file to /etc/pgbouncer and then creating the link pgbouncer.ini -> pgbouncer.tmp.ini

now this pgbouncer.tmp.ini was not in /tmp folder. so the followin code in staging.py 567 line was giving error :

if self.host not in ("localhost", "127.0.0.1"): os.unlink(newconffile) as it was not able to find the newconffile on that location.

After my modifications in staging-client.sh it is able to find the newconffile there but still i think unlink is not working.

himanchali avatar Jan 05 '10 06:01 himanchali

Could you run the unpatched pg_staging in debug mode and paste the output?

dimitri avatar Jan 05 '10 14:01 dimitri

See, the thing is that soft link stuff is not working. U create a soft link between pgbouncer.ini and pgbouncer.tmp.ini and then when u unlink the tmp file, then the original pgbouncer.ini files gets lost. And the above mentioned changes in staging_client.sh are necessary.

himanchali avatar Jan 06 '10 09:01 himanchali