9z0b3t1c / capistrano-resque

Capistrano integration for Resque

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cap 3 version requires sudo to resque:stop (or restart)

jash opened this issue · comments

I tried out this gem with Capistrano 3 and ran into the problem where it was requiring sudo in the resque:stop command. I do not want or need to use sudo to restart the resque processes.

lib/capistrano-resque/tasks/capistrano-resque.rake line 72 calls sudo and I didn't see a way to override it in Cap 3 without monkey-patching (which I ended up doing).

Question: If the resque process is started without sudo (using normal user permissions) why should it need sudo to stop it?! Can't we just remove that four letter word?

Yeah, it looks like while Capistrano 2 would recognize the use_sudo setting, Capistrano 3 will just force using sudo if a task tries to use it. I see capistrano/capistrano#920 was just opened addressing this issue.

Until something is done to Capistrano so that we don't need to worry about sudo, I'll look into adding a resque_use_sudo variable or something like that, defaulting to false. (I wasn't helping maintain the gem when the sudo stuff was added to the v2 version, so I don't want to just remove it completely without knowing why it was added).

On second though, I yanked the sudo stuff completely out. I went through the history of the repo and it's been in there since the first commits (so I can't find any rationale for it in the commit logs). Since we're not using sudo to start the workers, I can't think of any reason it would be necessary to stop them.

For the time being, you can point your Gemfile at the master branch of this repo, but we'll get an updated gem pushed out when we can.

@sshingler Your original code for the gem included try_sudo so if you know of a reason it should sitll be in there, please let me know and I'll add it back in. We may want to push out a new version of the gem soon too. If you give me push rights to the gem on rubygems, I can take care of it, just let me know.