lib/capistrano/tasks/monit.rake in capistrano-monit_runit-3.0.3 vs lib/capistrano/tasks/monit.rake in capistrano-monit_runit-3.0.4
- old
+ new
@@ -58,10 +58,11 @@
puts "#{fetch(:user)} ALL=NOPASSWD: /bin/chmod 6775 #{monit_etc_conf_d_path}"
puts "#{fetch(:user)} ALL=NOPASSWD: /bin/chown #{fetch(:user)}\\:root #{monit_etc_path}"
puts "#{fetch(:user)} ALL=NOPASSWD: /bin/chown #{fetch(:user)}\\:root #{monit_etc_conf_d_path}"
puts "#{fetch(:user)} ALL=NOPASSWD: /bin/chown #{fetch(:user)}\\:root #{monit_monitrc_file}"
puts "#{fetch(:user)} ALL=NOPASSWD: /bin/chown root\\:root #{monit_monitrc_file}"
+ puts "#{fetch(:user)} ALL=NOPASSWD: /bin/chown deploy\\:deploy #{monit_monitrc_file}"
puts "#{fetch(:user)} ALL=NOPASSWD: /usr/bin/monit *"
puts "#{fetch(:user)} ALL=NOPASSWD: /usr/sbin/service monit *"
puts "#{fetch(:user)} ALL=NOPASSWD: /bin/mkdir -p #{fetch(:monit_event_dir)}"
puts '# -----------------------------------------------------------------------------------------'
end
@@ -101,11 +102,12 @@
info "MONIT: Creating #{monit_monitrc_file} on #{host}"
execute :sudo, :chown, "#{fetch(:user)}:root #{monit_etc_path}"
execute :sudo, :chmod, "0775 #{monit_etc_path}"
execute :sudo, :chown, "#{fetch(:user)}:root #{monit_monitrc_file}"
if test("[ -e #{monit_monitrc_file} ]")
- execute :sudo, :rm, '-f #{monit_monitrc_file}'
+ execute :sudo, :chown, "deploy:deploy #{monit_monitrc_file}"
+ execute :rm, "-f #{monit_monitrc_file}"
end
upload! template_to_s_io(fetch(:monit_monitrc_template)), monit_monitrc_file
execute :sudo, :chmod, "0700 #{monit_monitrc_file}"
execute :sudo, :chown, "root:root #{monit_monitrc_file}"
@@ -132,10 +134,10 @@
desc 'Disable monit services for application'
task :disable do
on roles(:app) do |host|
if test("[ -h #{monit_etc_app_symlink} ]")
info "MONIT: Disabling for #{fetch(:application)} on #{host}"
- execute :rm, "-ff #{monit_etc_app_symlink}"
+ execute :rm, "-f #{monit_etc_app_symlink}"
else
info "MONIT: Already disabled for #{fetch(:application)} on #{host}"
end
end
end