1

I need to execute a script in Linux platform "runme.sh" (which can be executed as sudo user) using another ant script "build.xml". Now i have execute this build.xml from teamcity.

I have code for everything but got struck into while invoking "runme.sh" using sudo in build.xml from team city.

In build.xml i have code like

    <exec dir="${installdir}" executable="/bin/sh">
        <arg line="-c 'sudo ./runme.sh'"/>
        <redirector inputstring="sudopassword"/>        
    </exec>

In team city I get error as " [exec] sudo: sorry, you must have a tty to run sudo".

Can someone please help me resolve this error?

thanks in advance

coolgokul
  • 19
  • 1
  • 2
  • Post your sudoers file or at least the general options and fragments that should be permitting this commnad to run. Do you have the `requiretty` option set? – Zoredache Jul 30 '12 at 22:15

1 Answers1

1

If you type "sorry, you must have a tty to run sudo" in a search engine, you obtain the following instructions on first link (http://www.zimbra.com/forums/installation/10553-solved-sudo-sorry-you-must-have-tty-run-sudo.html):

" vi /etc/sudoers

comment out: #Default requiretty "

BR Eric