foreman 0.83.0 → 0.84.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4b47f2299ea8053d5c06ff2676d7839799a9d0cf
4
- data.tar.gz: 50e387ed25b8bb71b62ef69107d2d44022dc6f89
3
+ metadata.gz: 07592e3ada2314429eef1c9e1c0ba6bece95ab7e
4
+ data.tar.gz: 445fb48e93a2447988598b2db0f60a78c1991b14
5
5
  SHA512:
6
- metadata.gz: 827d667ac814592eb0b20d719e5997ab716a859a9bcc93f9a3fb62b1ddcd225af7f29650c6ea798a73f472be471fbeca3dd08154a0674f25aa88b2e0694f994a
7
- data.tar.gz: a4620d3b6937fe56caf2040ff9a7d982fa2e15d20cd85d031a356fb0284a68de78be736b336689dcf8e9cd5b78d2646c64a791d347f28a74f906124c8017ab19
6
+ metadata.gz: 546d1fb8701f569b96ba69885e6d390385abe15a309ffbe5a03a68a4cd074a878a0ba06d7dbe7f15bf0399e72c6c72097c8bfa10f94a8552b875787a9e88f1dd
7
+ data.tar.gz: d3a0b59f02ef1203f8cb4e8b354a789182cb7eaa9afd053a17bba0450f9f34ff03b287b410be514f8a759d9a7295ee080e14d75f073be65abc8281f5cd90c1f6
@@ -17,7 +17,6 @@ engine.each_process do |name, process|
17
17
  command=<%= process.command %>
18
18
  autostart=true
19
19
  autorestart=true
20
- stopsignal=QUIT
21
20
  stdout_logfile=<%= log %>/<%= name %>-<%= num %>.log
22
21
  stderr_logfile=<%= log %>/<%= name %>-<%= num %>.error.log
23
22
  user=<%= user %>
@@ -5,8 +5,10 @@ PartOf=<%= app %>-<%= name %>.target
5
5
  User=<%= user %>
6
6
  WorkingDirectory=<%= engine.root %>
7
7
  Environment=PORT=%i
8
- <% if !engine.env.empty? -%>Environment=<% engine.env.each_pair do |var,env| %>"<%= var.upcase %>=<%= env %>" <% end %><% end -%>
9
- ExecStart=/bin/bash -lc '<%= process.command %>'
8
+ <% engine.env.each_pair do |var,env| -%>
9
+ Environment="<%= var.upcase %>=<%= env %>"
10
+ <% end -%>
11
+ ExecStart=/bin/bash -lc 'exec <%= process.command %>'
10
12
  Restart=always
11
13
  StandardInput=null
12
14
  StandardOutput=syslog
@@ -10,7 +10,7 @@ class Foreman::Engine
10
10
 
11
11
  # The signals that the engine cares about.
12
12
  #
13
- HANDLED_SIGNALS = [ :TERM, :INT, :HUP ]
13
+ HANDLED_SIGNALS = [ :TERM, :INT, :HUP, :USR1, :USR2 ]
14
14
 
15
15
  attr_reader :env
16
16
  attr_reader :options
@@ -104,6 +104,8 @@ class Foreman::Engine
104
104
  handle_interrupt
105
105
  when :HUP
106
106
  handle_hangup
107
+ when *HANDLED_SIGNALS
108
+ handle_signal_forward(sig)
107
109
  else
108
110
  system "unhandled signal #{sig}"
109
111
  end
@@ -130,6 +132,11 @@ class Foreman::Engine
130
132
  @shutdown = true
131
133
  end
132
134
 
135
+ def handle_signal_forward(signal)
136
+ system "#{signal} received, forwarding it to children"
137
+ kill_children signal
138
+ end
139
+
133
140
  # Register a process to be run by this +Engine+
134
141
  #
135
142
  # @param [String] name A name for this process
@@ -1,5 +1,5 @@
1
1
  module Foreman
2
2
 
3
- VERSION = "0.83.0"
3
+ VERSION = "0.84.0"
4
4
 
5
5
  end
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "FOREMAN" "1" "January 2017" "Foreman 0.83.0" "Foreman Manual"
4
+ .TH "FOREMAN" "1" "January 2017" "Foreman 0.84.0" "Foreman Manual"
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBforeman\fR \- manage Procfile\-based applications
@@ -60,6 +60,12 @@ describe Foreman::Export::Systemd, :fakefs do
60
60
  expect(File.read("/tmp/init/app-alpha@.service")).to match(/KEY=some "value"/)
61
61
  end
62
62
 
63
+ it "includes ExecStart line" do
64
+ engine.env['KEY'] = 'some "value"'
65
+ systemd.export
66
+ expect(File.read("/tmp/init/app-alpha@.service")).to match(/^ExecStart=/)
67
+ end
68
+
63
69
  context "with a formation" do
64
70
  let(:formation) { "alpha=2" }
65
71
 
@@ -2,7 +2,6 @@
2
2
  command=./alpha
3
3
  autostart=true
4
4
  autorestart=true
5
- stopsignal=QUIT
6
5
  stdout_logfile=/var/log/app/alpha-1.log
7
6
  stderr_logfile=/var/log/app/alpha-1.error.log
8
7
  user=app
@@ -13,7 +12,6 @@ environment=FOO="bar",URL="http://example.com/api?foo=bar&baz=1",PORT="5000"
13
12
  command=./bravo
14
13
  autostart=true
15
14
  autorestart=true
16
- stopsignal=QUIT
17
15
  stdout_logfile=/var/log/app/bravo-1.log
18
16
  stderr_logfile=/var/log/app/bravo-1.error.log
19
17
  user=app
@@ -24,7 +22,6 @@ environment=FOO="bar",URL="http://example.com/api?foo=bar&baz=1",PORT="5100"
24
22
  command=./foo_bar
25
23
  autostart=true
26
24
  autorestart=true
27
- stopsignal=QUIT
28
25
  stdout_logfile=/var/log/app/foo_bar-1.log
29
26
  stderr_logfile=/var/log/app/foo_bar-1.error.log
30
27
  user=app
@@ -35,7 +32,6 @@ environment=FOO="bar",URL="http://example.com/api?foo=bar&baz=1",PORT="5200"
35
32
  command=./foo-bar
36
33
  autostart=true
37
34
  autorestart=true
38
- stopsignal=QUIT
39
35
  stdout_logfile=/var/log/app/foo-bar-1.log
40
36
  stderr_logfile=/var/log/app/foo-bar-1.error.log
41
37
  user=app
@@ -2,7 +2,6 @@
2
2
  command=./alpha
3
3
  autostart=true
4
4
  autorestart=true
5
- stopsignal=QUIT
6
5
  stdout_logfile=/var/log/app/alpha-1.log
7
6
  stderr_logfile=/var/log/app/alpha-1.error.log
8
7
  user=app
@@ -13,7 +12,6 @@ environment=PORT="5000"
13
12
  command=./alpha
14
13
  autostart=true
15
14
  autorestart=true
16
- stopsignal=QUIT
17
15
  stdout_logfile=/var/log/app/alpha-2.log
18
16
  stderr_logfile=/var/log/app/alpha-2.error.log
19
17
  user=app
@@ -5,7 +5,7 @@ PartOf=app-alpha.target
5
5
  User=app
6
6
  WorkingDirectory=/tmp/app
7
7
  Environment=PORT=%i
8
- ExecStart=/bin/bash -lc './alpha'
8
+ ExecStart=/bin/bash -lc 'exec ./alpha'
9
9
  Restart=always
10
10
  StandardInput=null
11
11
  StandardOutput=syslog
@@ -5,7 +5,7 @@ PartOf=app-bravo.target
5
5
  User=app
6
6
  WorkingDirectory=/tmp/app
7
7
  Environment=PORT=%i
8
- ExecStart=/bin/bash -lc './bravo'
8
+ ExecStart=/bin/bash -lc 'exec ./bravo'
9
9
  Restart=always
10
10
  StandardInput=null
11
11
  StandardOutput=syslog
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.83.0
4
+ version: 0.84.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Dollar
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-18 00:00:00.000000000 Z
11
+ date: 2017-03-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor