last day (14 days later) » 

7:18 PM
0
Q: AWS Opsworks: Restart Service after deploy

darkcodeI'm using AWS Opsworks for a Rails Application, I have an Upstart Service to start/stop/restart Sidekiq ej: sudo service sidekiq restart So now after every deployment I want run sudo service sidekiq restart to restart Sidekiq, how I can do it? Edit: I'm not using Capistrano, is possible to do i...

 
How are you doing the deployment?
 
I go to my aws account then Opsworks > Select Stack > Deployments > Deploy and App
 
Add this to your after_restart.rb "execute 'trigger sudo service sidekiq restart' do"
 
execute 'trigger sudo service sidekiq restart'? or I also need the final "do"
 
You will need the final "do" too.
 
7:18 PM
SyntaxError ----------- .../releases/20160721191145/deploy/after_restart.rb:2: syntax error, unexpected end-of-input . This is what I have in my after_restart.rb file => Chef::Log.info("==== Restart sidekiq...") execute 'trigger sudo service sidekiq restart' do
 
Can you paste after_restart.rb?
 
execute 'trigger sudo service sidekiq restart' do
Hi
 
Thanks mate
this is whay I have in my after_restart.rb
Chef::Log.info("==== Restart sidekiq...")
execute 'trigger sudo service sidekiq restart'
with the final do sorry
Chef::Log.info("==== Restart sidekiq...")
execute 'trigger sudo service sidekiq restart' do
without the final do it also raise an error: had an error: Errno::ENOENT: No such file or directory - trigger
 
Ok did you check this approach docs.chef.io/resource_service.html
check the ;last example for apache
Some thing like this
service 'some_service' do
provider Chef::Provider::Service::Upstart
supports :status => true, :restart => true, :reload => true
action [ :enable, :start ]
end
 
7:25 PM
I have to add that in my cookbooks no?
 
Yes in your cook book
 
7:44 PM
I forked this repository github.com/aws/opsworks-cookbooks, I'm using the forked reposiroty as the custom cookbook
but I'm not sure where I can add that new code
service 'some_service' do
provider Chef::Provider::Service::Upstart
supports :status => true, :restart => true, :reload => true
action [ :enable, :start ]
end
 

last day (14 days later) »