Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
be593846e2 | ||
|
|
2458c4e75f | ||
|
|
314e2f5530 |
@@ -1,8 +1,8 @@
|
||||
pre-start script
|
||||
|
||||
bash << "EOF"
|
||||
mkdir -p <%= log_root %>/<%= app %>
|
||||
chown -R <%= user %> <%= log_root %>/<%= app %>
|
||||
mkdir -p <%= log_root %>
|
||||
chown -R <%= user %> <%= log_root %>
|
||||
EOF
|
||||
|
||||
end script
|
||||
|
||||
@@ -3,4 +3,4 @@ stop on stopping <%= app %>-<%= process.name %>
|
||||
respawn
|
||||
|
||||
chdir <%= engine.directory %>
|
||||
exec su <%= user %> -c "<%= process.command %> >> <%= log_root %>/<%=app%>/<%=process.name%>-<%=num%>.log 2>&1"
|
||||
exec su <%= user %> -c "<%= process.command %> >> <%= log_root %>/<%=process.name%>-<%=num%>.log 2>&1"
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
Gem::Specification.new do |s|
|
||||
s.name = %q{foreman}
|
||||
s.version = "0.4.6"
|
||||
s.version = "0.4.7"
|
||||
|
||||
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
||||
s.authors = ["David Dollar"]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module Foreman
|
||||
|
||||
VERSION = "0.4.6"
|
||||
VERSION = "0.4.7"
|
||||
|
||||
class AppDoesNotExist < Exception; end
|
||||
|
||||
|
||||
@@ -7,23 +7,21 @@ class Foreman::Export::Inittab < Foreman::Export::Base
|
||||
user = options[:user] || app
|
||||
log_root = options[:log] || "/var/log"
|
||||
|
||||
log_dir = "#{log_root}/#{app}"
|
||||
|
||||
concurrency = parse_concurrency(options[:concurrency])
|
||||
|
||||
inittab = []
|
||||
inittab << "# ----- foreman #{app} processes -----"
|
||||
engine.processes.values.each_with_index do |process, num|
|
||||
id = app.slice(0, 2).upcase + sprintf("%02d", num+1)
|
||||
inittab << "#{id}:4:respawn:/bin/su - #{user} -c '#{process.command} >> #{log_dir}/#{process.name}-#{num+1}.log 2>&1'"
|
||||
inittab << "#{id}:4:respawn:/bin/su - #{user} -c '#{process.command} >> #{log_root}/#{process.name}-#{num+1}.log 2>&1'"
|
||||
end
|
||||
inittab << "# ----- end foreman #{app} processes -----"
|
||||
|
||||
inittab = inittab.join("\n") + "\n"
|
||||
|
||||
if fname
|
||||
FileUtils.mkdir_p(log_dir)
|
||||
FileUtils.chown(user, nil, log_dir)
|
||||
FileUtils.mkdir_p(log_root)
|
||||
FileUtils.chown(user, nil, log_root)
|
||||
write_file(fname, inittab)
|
||||
else
|
||||
puts inittab
|
||||
|
||||
@@ -10,7 +10,7 @@ class Foreman::Export::Upstart < Foreman::Export::Base
|
||||
|
||||
app = options[:app] || File.basename(engine.directory)
|
||||
user = options[:user] || app
|
||||
log_root = options[:log] || "/var/log"
|
||||
log_root = options[:log] || "/var/log/#{app}"
|
||||
|
||||
Dir["#{location}/#{app}*.conf"].each do |file|
|
||||
say "cleaning up: #{file}"
|
||||
|
||||
Reference in New Issue
Block a user