Ask Your Question
0

you must have a tty to run sudo

asked 2017-10-25 10:52:40 -0600

I'm trying to push tripwire agent from puppet to the hosts. i've written a bunch of bash code to be executed by puppet run. But it throws error below, which is kind of wierd. Some of the RHEL 6 servers throws that error, some of them don't. Any thoughts on this will be appreciated.

Debug: Execinstallagent: Executing check '["/bin/sh", "-c", "/usr/bin/test rpm -qa TWeagent != \"TWeagent-8.5.2-0.x8664\""]' Debug: Executing: '/bin/sh -c /usr/bin/test rpm -qa TWeagent != "TWeagent-8.5.2-0.x8664"' Debug: Execinstallagent: Executing '["/bin/sh", "-c", "/usr/bin/sudo service twdaemon stop; /usr/bin/sudo /usr/local/tripwire/te/agent/bin/uninstall.sh; /usr/bin/sudo rm -rf /usr/local/tripwire"]' Debug: Executing: '/bin/sh -c /usr/bin/sudo service twdaemon stop; /usr/bin/sudo /usr/local/tripwire/te/agent/bin/uninstall.sh; /usr/bin/sudo rm -rf /usr/local/tripwire' Notice: /Stage[main]/Redhattripwire/Exec[installagent]/returns: sudo: sorry, you must have a tty to run sudo Notice: /Stage[main]/Redhattripwire/Exec[installagent]/returns: sudo: sorry, you must have a tty to run sudo Notice: /Stage[main]/Redhattripwire/Exec[installagent]/returns: sudo: sorry, you must have a tty to run sudo Error: /usr/bin/sudo service twdaemon stop; /usr/bin/sudo /usr/local/tripwire/te/agent/bin/uninstall.sh; /usr/bin/sudo rm -rf /usr/local/tripwire returned 1 instead of one of [0] Error: /Stage[main]/Redhattripwire/Exec[installagent]/returns: change from notrun to 0 failed: /usr/bin/sudo service twdaemon stop; /usr/bin/sudo /usr/local/tripwire/te/agent/bin/uninstall.sh; /usr/bin/sudo rm -rf /usr/local/tripwire returned 1 instead of one of [0] Debug: Class[Redhat_tripwire]: Resource is being skipped, unscheduling all events

Thanks, Suresh

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2017-10-26 10:00:41 -0600

csharpsteen gravatar image

This usually means that requiretty is set in /etc/sudoers which requires all uses of sudo to be associated with a terminal that has a TTY. This requirement was a default in RedHat 6 which is massively inconvenient for scripting and automation (executing commands on Vagrant VMs is where I had to fight it), it was raised as a bug and eventually removed from RedHat variants:

https://bugzilla.redhat.com/show_bug....

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2017-10-25 10:52:40 -0600

Seen: 25 times

Last updated: Oct 26