I guess turning off tty (at least on RHEL like distors switched on by default) should solve the problem, just comment line Defaults requiretty in /etc/sudoers Of course you should have setup sudo not to ask passwd (NOPASSWD option)
On Tuesday 26 June 2012 08:23:19 Stanley, Jason wrote: > Ah...I encountered this same problem. > > In my environment, I have the master/slave configuration. > > For a workaround, I had Jenkins call this script on the slave machine. > > For example, let's call your script pg_cluster.sh > > I would place this script on the slave machine and in my Jenkins job, I > issued the following command: > > ssh <slave machine> pg_cluster.sh > > > > From: jenkinsci-users@googlegroups.com > [mailto:jenkinsci-users@googlegroups.com] On Behalf Of Varghese Renny Sent: > Tuesday, June 26, 2012 8:16 AM > To: jenkinsci-users@googlegroups.com > Subject: Re: Re: Re: jenkins java.outofmemory:permGen space error > > #!/bin/sh > pid=$(pidof postgres) > echo $pid > kill $pid > pg_ctlcluster 8.4 main start > > Actually this shell script is working if i execute like bash > killpostgres.sh But inside the jenkins it's showing error like > > > > sudo: no tty present and no askpass program specified > > sudo: no tty present and no askpass program specified > > Sorry, try again. > > sudo: no tty present and no askpass program specified > > sudo: no tty present and no askpass program specified > > Sorry, try again. > > sudo: no tty present and no askpass program specified > > sudo: no tty present and no askpass program specified > > Sorry, try again. > > sudo: 3 incorrect password attempts > > > Thanks