Skip to content

Commit

Permalink
Make sure to use bash
Browse files Browse the repository at this point in the history
  • Loading branch information
Hari Manikarnika & Michael Sofaer committed Jan 25, 2011
1 parent b4138dc commit 1faf689
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/hellspawn.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ def flag_snippet
self[:flags].map{|k,v| k + " " + v.to_s}.join(" ")
end
def log_script log_dir
"exec multilog #{log_dir}/#{self[:name]}.log"
"#! /bin/bash\nexec multilog #{log_dir}/#{self[:name]}.log"
end
def run_prep
"exec 2&>1" + dir_snippet
"#! /bin/bash\nexec 2>&1" + dir_snippet
end
def dir_snippet
"\ncd #{self[:directory]}" if key? :directory
Expand Down
6 changes: 4 additions & 2 deletions test/hellspawn_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def test_march
@legion.march!
run_script = File.read("#{@base}/thin/run")
assert { run_script.match /exec \/usr\/local\/bin\/thin/ }
assert { run_script.match /#!.*bash/ }
end
def test_legion_dir
@legion.summon @thin
Expand Down Expand Up @@ -57,7 +58,8 @@ def test_daemon_log_script
@legion.summon @thin
@legion.march!
run_script = File.read("#{@base}/thin/log/run")
assert { run_script.split("\n").first == "exec multilog #{@log_dir}/thin.log" }
assert { run_script.match /#!.*bash/ }
assert { run_script.match /exec multilog #{@log_dir}\/thin.log/ }
end
def test_flags
@legion.summon @thin
Expand All @@ -74,7 +76,7 @@ def test_stderr
@legion.summon @thin
@legion.march!
run_script = File.read("#{@base}/thin/run")
assert { run_script.split("\n").first == "exec 2&>1" }
assert { run_script.match /exec 2>&1/ }
end
def test_removal
@legion.summon @thin
Expand Down

0 comments on commit 1faf689

Please sign in to comment.