diff --git a/lib/foreman/engine.rb b/lib/foreman/engine.rb index 5b96b91..221b195 100644 --- a/lib/foreman/engine.rb +++ b/lib/foreman/engine.rb @@ -256,7 +256,10 @@ private 1.upto(formation[@names[process]]) do |n| reader, writer = create_pipe begin - pid = process.run(:output => writer, :env => { "PORT" => port_for(process, n).to_s }) + pid = process.run(:output => writer, :env => { + "HOME" => process.cwd, + "PORT" => port_for(process, n).to_s + }) writer.puts "started with pid #{pid}" rescue Errno::ENOENT writer.puts "unknown command: #{process.command}" diff --git a/lib/foreman/process.rb b/lib/foreman/process.rb index fd17928..c395a6d 100644 --- a/lib/foreman/process.rb +++ b/lib/foreman/process.rb @@ -90,8 +90,10 @@ class Foreman::Process !alive? end -private - + # Returns the working directory for this +Process+ + # + # @returns [String] + # def cwd File.expand_path(@options[:cwd] || ".") end