Permalink
Browse files

Separation of service script creation and execution

  • Loading branch information...
1 parent 730d365 commit 4dbce5c204b40d2666b27a675e880ba6e9984ac0 @timf timf committed Feb 1, 2011
Showing with 13 additions and 7 deletions.
  1. +13 −7 cookbooks/burned_ubuntu64/recipes/default.rb
@@ -79,14 +79,9 @@
owner "#{node[:username]}"
variables(:service_name => service)
end
-
- bash "start-service" do
+ bash "service-script" do
user node[:username]
- environment({
- "HOME" => "/home/#{node[:username]}",
- "ION_ALTERNATE_LOGGING_CONF" => "#{logging_config}"
- })
cwd "/home/#{node[:username]}/ioncore-python"
code <<-EOH
echo "#!/bin/bash" >> start-#{service}.sh
@@ -97,8 +92,19 @@
echo "export ION_ALTERNATE_LOGGING_CONF=#{logging_config}" >> start-#{service}.sh
echo "twistd --pidfile=#{service}-service.pid cc -n -h #{node[:capabilitycontainer][:broker]} --broker_heartbeat=#{node[:capabilitycontainer][:broker_heartbeat]} -a processes=#{service_config},sysname=#{node[:capabilitycontainer][:sysname]} #{node[:capabilitycontainer][:bootscript]}" >> start-#{service}.sh
chmod +x start-#{service}.sh
- ./start-#{service}.sh
EOH
end
+ bash "start-service" do
+ not_if { node.include? "do_not_start" and node[:do_not_start].include? service }
+ user node[:username]
+ cwd "/home/#{node[:username]}/ioncore-python"
+ environment({
+ "HOME" => "/home/#{node[:username]}",
+ "ION_ALTERNATE_LOGGING_CONF" => "#{logging_config}"
+ })
+ code <<-EOH
+ ./start-#{service}.sh
+ EOH
+ end
end

0 comments on commit 4dbce5c

Please sign in to comment.