I have the following capistrano 3 task:
desc 'Add root scheduled tasks'
task :root_schedules do
on roles(:all) do
within release_path do
execute :sudo, :bundle, 'exec whenever -w config/root_schedule.rb -u root'
end
end
end
I need this task to run with sudo privileges because I need the scheduled tasks to run with higher privileges. These are backend scheduled server tasks. Problem is that everytime I run this command I get following:
DEBUG [46d3800c] [sudo] password for [user]
After I type my password and hit enter, it never completes anything. No response at all. Any answers out there?
I just created a gem for this purpose: sshkit-sudo
gem 'sshkit-sudo'
to Gemfilerequire 'sshkit/sudo'
to CapfileNow you can use sudo
command in your Capistrano 3 task.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With