Feature Requests: Browse | Submit New | Admin

[#28586] start_web/stop_web to use sudo if required

Date:
2010-09-21 12:54
Priority:
3
Submitted By:
Brian Candler (bcandler)
Assigned To:
Nobody (None)
Category:
None
State:
Open
Summary:
start_web/stop_web to use sudo if required

Detailed description
The existing start_web/stop_web tasks use 'run' rather than 'sudo'. It would be nice if this could be configurable.
I think there is a reference to this in considerations.txt

It *is* possible to override these tasks, but it means clearing them and re-implementing them from scratch.

namespace :vlad do
  desc "(Re)Start the web servers"

  Rake::Task['vlad:start_web'].remote_actions.clear
  remote_task :start_web, :roles => :web  do
    sudo "#{web_command} restart"
  end

  desc "Stop the web servers"

  Rake::Task['vlad:stop_web'].remote_actions.clear
  remote_task :stop_web, :roles => :web  do
    sudo "#{web_command} stop"
  end
end

Add A Comment: Notepad

Please login


Followup

No Followups Have Been Posted

Attached Files:

Name Description Download
No Files Currently Attached

Changes:

No Changes Have Been Made to This Item