Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix the issue that sudo tasks hang on password input. #105

Closed
wants to merge 1 commit into from

Conversation

hardywu
Copy link

@hardywu hardywu commented May 18, 2015

The sudo related tasks hang on the password input. It may be due to the deprecation of sudo in Capistrano 3. So I walkaround the issue by utilizing the ask method.

@olance
Copy link

olance commented May 22, 2015

👍
Just spent an hour configuring visudo.... would love this to be merged ^^

@seuros
Copy link
Owner

seuros commented May 22, 2015

I think this helper should be part of capistrano so other gems can use it.
ping @leehambley , @kirs

@leehambley
Copy link

@robd
Copy link

robd commented May 22, 2015

Hi all

I am working up native support for interactive sudo in SSHKit, and interactive commands are the first part of this. These are in SSHKit master, but unreleased - you could look to use an interaction_handler in your sudo_command method to remove the pipe.

The other part of this problem is to work on the Command Map, so that calls to sudo can be mapped to use an interactive sudo interaction handler in one place. I hope this will also make sure that users can hook interactive sudo on any gem without having to monkey patch.

This is parked as I work on some unrelated cleanup in SSHKit, but I hope to be able to resume work on this soon.

@leehambley
Copy link

Thanks for chiming in here @robd I didn't want to force more work down your throat, just to put this issue on your radar as another possible use-case, and as evidence that your work is having a profound and useful impact :)

@robd
Copy link

robd commented May 22, 2015

@leehambley no probs - thank you. It's useful to be made aware of issues related to my work so please keep them coming.

@mathieugagne
Copy link

👍 I do not have sudo access but I do have write access to my nginx install directory. Can't use this feature unless it is sudoless

@robd
Copy link

robd commented Jul 16, 2015

@mathieugagne I'm not exactly sure which sudo method is being called here, but if it is the one in the capistrano dsl, would it work to just override it like this?

# Bottom of Capfile
module Capistrano
  module DSL
    def sudo(*args)
      execute(*args)
    end
  end
end

@mathieugagne
Copy link

sudo methods for nginx_conf:
https://github.com/seuros/capistrano-puma/blob/master/lib/capistrano/tasks/nginx.cap#L6

Yeah I could. Since the code is not that complicated I just took the parts of the gem I was interested in. start/stop/restart.. methods are done with runit in my case so I had to override quite a few parts. I basically took the templates and merged them with my recipes.

Thanks!

@seuros seuros added the stale label Nov 3, 2020
@seuros seuros closed this Nov 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants