Open rubiojr opened 12 years ago
Not really sure of the consequences but anyway, here's the patch that works for me:
--- /home/rubiojr/.rvm/gems/ruby-1.9.3-p194/gems/rye-0.9.7/lib/rye/box.rb 2012-09-06 00:31:52.393855539 +0200
+++ /home/rubiojr/.rvm/gems/ruby-1.9.3-p194/gems/rye-0.9.7/lib/rye/box.rb.new 2012-09-06 00:31:34.417766396 +0200
@@ -894,7 +894,7 @@
:modes => {} }
channel = @rye_ssh.open_channel do |channel|
- if self.rye_shell && blk.nil?
+ if (self.rye_shell && blk.nil?) or sudo?
channel.request_pty(pty_opts) do |ch,success|
self.rye_pty = success
raise Rye::NoPty if !success
Looks like that's only part of the equation unfortunately, since box.sudo? evals to false when using box.sudo instead of box.enable_sudo and then running the command with execute.
I don't have any solution for this currently unfortunately (other than to update the sudoers config).
Anything new on this? I also have a situation where I need to ship a program to 3rd parties and can't control the Sudoers file. It looks like Centos 6 at least sets requiretty as the default.
@rberger I did find a solution to the problem and I've been using it with CentOS boxes since then:
https://github.com/rubiojr/shexy/blob/master/lib/shexy.rb#L104
If you are using an Amazon linux AMI that supports user data, it's probably best to just change the sudoers config like this: https://github.com/mitchellh/vagrant/issues/1482#issuecomment-17444459
Hey Delano,
Having issues with:
or
when /etc/sudoers has "Defaults requiretty" (like CentOS):
Haven't been able to find a good way to cope with this without patching. Any hints?