diff options
author | Gareth Rees <gareth@mysociety.org> | 2015-02-18 16:43:53 +0000 |
---|---|---|
committer | Gareth Rees <ADD_EMAIL_HERE> | 2015-03-09 09:52:07 +0000 |
commit | f9e72d804d627e9a38245d6480c43f48cc59a247 (patch) | |
tree | 357a152b3cde9173cae76b892d4d29be52900a0b | |
parent | 8c4e401f7a7f5ac4149f007cd0cf36968045d329 (diff) |
Restart alaveteli by service command
- daemon_name defaults to "alaveteli"
- daemon_name can be set per-environment in config/deploy.yml
-rw-r--r-- | config/deploy.rb | 5 | ||||
-rw-r--r-- | config/deploy.yml.example | 2 |
2 files changed, 5 insertions, 2 deletions
diff --git a/config/deploy.rb b/config/deploy.rb index c1954d058..f4a0b536a 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -14,6 +14,7 @@ set :deploy_to, configuration['deploy_to'] set :user, configuration['user'] set :use_sudo, false set :rails_env, configuration['rails_env'] +set :daemon_name, configuration.fetch('daemon_name', 'alaveteli') server configuration['server'], :app, :web, :db, :primary => true @@ -35,9 +36,9 @@ end namespace :deploy do [:start, :stop, :restart].each do |t| - desc "#{t.to_s.capitalize} Alaveteli service defined in /etc/init.d/alaveteli" + desc "#{t.to_s.capitalize} Alaveteli service defined in /etc/init.d/" task t, :roles => :app, :except => { :no_release => true } do - run "/etc/init.d/alaveteli #{t}" + run "service #{ daemon_name } #{ t }" end end diff --git a/config/deploy.yml.example b/config/deploy.yml.example index a20eb3c22..93aba439a 100644 --- a/config/deploy.yml.example +++ b/config/deploy.yml.example @@ -6,6 +6,7 @@ production: user: deploy rails_env: production deploy_to: /srv/www/alaveteli_production + daemon_name: alaveteli staging: repository: git://github.com/mysociety/alaveteli.git branch: develop @@ -13,3 +14,4 @@ staging: user: deploy rails_env: production deploy_to: /srv/www/alaveteli_staging + daemon_name: alaveteli_staging |