Merge pull request #5 from phemmer/systemd-dependencies
export: fix systemd dependencies
This commit is contained in:
@@ -1 +1,6 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
|
StopWhenUnneeded=true
|
||||||
|
Wants=<%= process_master_names.join(' ') %>
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
|||||||
@@ -13,6 +13,3 @@ StandardOutput=syslog
|
|||||||
StandardError=syslog
|
StandardError=syslog
|
||||||
SyslogIdentifier=%n
|
SyslogIdentifier=%n
|
||||||
KillMode=process
|
KillMode=process
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=<%= app %>-<%= name %>.target
|
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
StopWhenUnneeded=true
|
StopWhenUnneeded=true
|
||||||
|
Wants=<%= process_names.join(' ') %>
|
||||||
[Install]
|
|
||||||
WantedBy=<%= app %>.target
|
|
||||||
|
|||||||
@@ -10,16 +10,23 @@ class Foreman::Export::Systemd < Foreman::Export::Base
|
|||||||
clean file
|
clean file
|
||||||
end
|
end
|
||||||
|
|
||||||
write_template "systemd/master.target.erb", "#{app}.target", binding
|
process_master_names = []
|
||||||
|
|
||||||
engine.each_process do |name, process|
|
engine.each_process do |name, process|
|
||||||
next if engine.formation[name] < 1
|
next if engine.formation[name] < 1
|
||||||
write_template "systemd/process_master.target.erb", "#{app}-#{name}.target", binding
|
|
||||||
|
process_names = []
|
||||||
|
|
||||||
1.upto(engine.formation[name]) do |num|
|
1.upto(engine.formation[name]) do |num|
|
||||||
port = engine.port_for(process, num)
|
port = engine.port_for(process, num)
|
||||||
write_template "systemd/process.service.erb", "#{app}-#{name}-#{num}.service", binding
|
write_template "systemd/process.service.erb", "#{app}-#{name}-#{num}.service", binding
|
||||||
end
|
process_names << "#{app}-#{name}-#{num}.service"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
write_template "systemd/process_master.target.erb", "#{app}-#{name}.target", binding
|
||||||
|
process_master_names << "#{app}-#{name}.target"
|
||||||
|
end
|
||||||
|
|
||||||
|
write_template "systemd/master.target.erb", "#{app}.target", binding
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user