Tom Robinson wrote:
I need to run an "exec" task with superuser privileges but I've run into two problems with two different approaches:

1) Running "sudo ant" doesn't give me access to my user environment variables.

2) If I do <exec executable = "sudo" ><arg value = "actual_command" /></exec> it works, but only if I've entered my password for sudo recently... I can't enter the password for sudo through ant (I have to hit enter twice, then it says "Sorry, try again", at which point if I enter it again it *sometimes* works).

Resolving #1 would be ideal, and negate the need for resolving #2. I'm on Mac OS X (Leopard), if that matters.

The way we do root level access is to ssh in to localhost and run stuff as root there. you can either set up the <ssh> command with the relevant (property driven) password, or set up the ssh keys so that you can ssh in to [EMAIL PROTECTED] using keys alone.

--
Steve Loughran                  http://www.1060.org/blogxter/publish/5
Author: Ant in Action           http://antbook.org/

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to