diff --git a/lib/foreman/export/runit.rb b/lib/foreman/export/runit.rb index bc7a5f5..3b49aa7 100644 --- a/lib/foreman/export/runit.rb +++ b/lib/foreman/export/runit.rb @@ -29,7 +29,8 @@ class Foreman::Export::Runit < Foreman::Export::Base run = ERB.new(run_template).result(binding) write_file "#{process_directory}/run", run - + FileUtils.chmod 0755, "#{process_directory}/run" + port = engine.port_for(process, num, options[:port]) environment_variables = {'PORT' => port}. merge(engine.environment). @@ -41,7 +42,7 @@ class Foreman::Export::Runit < Foreman::Export::Base log_run = ERB.new(log_run_template).result(binding) write_file "#{process_log_directory}/run", log_run - + FileUtils.chmod 0755, "#{process_log_directory}/run" end end diff --git a/spec/foreman/export/runit_spec.rb b/spec/foreman/export/runit_spec.rb index 9218bfa..2992210 100644 --- a/spec/foreman/export/runit_spec.rb +++ b/spec/foreman/export/runit_spec.rb @@ -10,6 +10,7 @@ describe Foreman::Export::Runit do before(:each) { load_export_templates_into_fakefs("runit") } before(:each) { stub(runit).say } + before(:each) { stub(FakeFS::FileUtils).chmod } it "exports to the filesystem" do FileUtils.mkdir_p('/tmp/init')