[Novalug] Installing rpms via an automated script

John Holland jbholland@gmail.com
Sun Mar 11 20:07:00 EDT 2012


On 3/11/12 3:45 PM, Dan Lavu wrote:
>
> James,
>
>  
>
> I'm pretty sure I know what the issue is, sudo by default requires a
> tty session, you can edit your sudoers file and disable require notty,
> that should fix it. If that doesn't work, you can run your script and
> put the following at the '$script > $log.file  2&<1' and it will
> redirect all the default output to a text file so you can find out
> what is holding you up.
>
>  
>
> Dan
>
>  
>
Since I've been on record lately as asking why not have root log in, I
will suggest that a script that contains commands run via sudo with no
password could just as well be a script that is run BY root. Or you
could run the whole thing by sudo. If there are parts of the script that
should be run by a non-root user they could be run via su in the script
to the appropriate user, which could include a sub-script to be all run
as some non-root user. Just thinking you could approach it from the
other side. (run as root and de-privilege rather than the opposite)

The requiring a tty session is a pretty difficult thing to figure out, I
think I ran into this a while back but I didn't remember it until Dan
explained it.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.firemountain.net/pipermail/novalug/attachments/20120311/64d83025/attachment.htm>


More information about the Novalug mailing list