ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Neil J. O'Neill" <njone...@llnl.gov>
Subject Re: execute command as root
Date Tue, 20 Apr 2004 20:31:38 GMT
You can run su inside of an xterm:

    <exec
      executable="/usr/X11R6/bin/xterm"
    >
      <arg 
        line='-e su -c "chown -R someUser /var/tomcat" root'
      />
    </exec>


--NJO



On Tue, 2004-04-20 at 12:26, stevecanfield@yahoo.com wrote:
> I have a script that needs to chown some files as
> root, but I don't want to have to execute everything
> as root. I've been trying to use 'su' with no success.
> Any ideas? I've been trying variations on the
> following:
>   <exec executable="su">
>     <arg value="-c 'chown -R someUser /var/tomcat'
> root"/>
>   </exec>
> 
> I've also tried running it from a shell:
>   <exec executable="sh">
>     <arg line="su -c 'chown -R someUser /var/tomcat'
> root"/>
>   </exec>
> 
> Should I be able to do something like this? I either
> get an error telling me that su wants input from stdin
> or that sh cannot run an executable.
> 
> -sc
> 
> 
> 	
> 		
> __________________________________
> Do you Yahoo!?
> Yahoo! Photos: High-quality 4x6 digital prints for 25
> http://photos.yahoo.com/ph/print_splash
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message