bluepill 0.2.3 → 0.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -1
- data/README.md +2 -2
- data/bin/bluepill +1 -2
- data/bluepill.gemspec +1 -1
- data/lib/bluepill/daemonize.rb +6 -10
- data/lib/bluepill/dsl/process_factory.rb +1 -1
- data/lib/bluepill/process/transition_callbacks.rb +4 -6
- data/lib/bluepill/process_conditions/http.rb +4 -2
- data/lib/bluepill/process_conditions/zombie_process.rb +1 -1
- data/lib/bluepill/process_journal/cleanup.rb +4 -6
- data/lib/bluepill/socket.rb +4 -6
- data/lib/bluepill/version.rb +7 -7
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5288f18359d2a2384f55d6b9d245b37182bda58cf9588301d02738caaaad631c
|
|
4
|
+
data.tar.gz: 1447ebe71f6ebe9be37ab4edd2ac3b695582b96995c2e3bb00ad1f20ec3a0361
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a837a60160c8aebb1dffc7d5206d30e79f9f84f2c4e65d6c879de0a94f9ffe7bb961c6aa0b0bdd7443fcdff60bb5ca8204a733058becf3fa5e2e320b70b458ad
|
|
7
|
+
data.tar.gz: 81fcacb8b9618c91dce85f862312e90c2a3bdd227500e795310d8d7646e001224bd27d37a36abb06a1b27ac4a4d77cca8ec5148d6b4ff12c09f2e53275d9ea37
|
data/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.2.5] - 2026-11-02
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
- The `zombie_process` check tests for `<defunct>` with `match?`, so each check makes one fewer object.
|
|
15
|
+
|
|
16
|
+
### Removed
|
|
17
|
+
|
|
18
|
+
- **Breaking:** support for Ruby 2.3 and 2.4, and for JRuby 9.1, which runs Ruby 2.3 code. Bluepill 0.2.5 needs Ruby 2.5 or newer, or JRuby 9.2 or newer. Bluepill 0.2.3 still runs on them.
|
|
19
|
+
|
|
10
20
|
## [0.2.3] - 2026-11-02
|
|
11
21
|
|
|
12
22
|
### Changed
|
|
@@ -832,7 +842,8 @@ Initial release.
|
|
|
832
842
|
- Added the `bluepill` CLI with the `load`, `status`, `start`, `stop`, `restart`, `unmonitor`, `quit` and `log` commands.
|
|
833
843
|
- Added syslog logging.
|
|
834
844
|
|
|
835
|
-
[unreleased]: https://github.com/bluepill-rb/bluepill/compare/v0.2.
|
|
845
|
+
[unreleased]: https://github.com/bluepill-rb/bluepill/compare/v0.2.5...HEAD
|
|
846
|
+
[0.2.5]: https://github.com/bluepill-rb/bluepill/compare/v0.2.3...v0.2.5
|
|
836
847
|
[0.2.3]: https://github.com/bluepill-rb/bluepill/compare/v0.2.1...v0.2.3
|
|
837
848
|
[0.2.1]: https://github.com/bluepill-rb/bluepill/compare/v0.2.0...v0.2.1
|
|
838
849
|
[0.2.0]: https://github.com/bluepill-rb/bluepill/compare/v0.1.6...v0.2.0
|
data/README.md
CHANGED
|
@@ -504,10 +504,10 @@ JRuby allows you to run bluepill only in the foreground.
|
|
|
504
504
|
This library aims to support and is [tested against][ci] the following Ruby
|
|
505
505
|
implementations:
|
|
506
506
|
|
|
507
|
-
* Ruby 2.
|
|
507
|
+
* Ruby 2.5 through 2.7
|
|
508
508
|
* Ruby 3.0 through 3.4
|
|
509
509
|
* Ruby 4.0
|
|
510
|
-
* JRuby 9.
|
|
510
|
+
* JRuby 9.2 through 9.4 (only in the foreground)
|
|
511
511
|
* JRuby 10.0 and 10.1 (only in the foreground)
|
|
512
512
|
|
|
513
513
|
If something doesn't work on one of these interpreters, please open an issue.
|
data/bin/bluepill
CHANGED
|
@@ -69,8 +69,7 @@ end
|
|
|
69
69
|
|
|
70
70
|
APPLICATION_COMMANDS = %w[status start stop restart unmonitor quit log].freeze
|
|
71
71
|
|
|
72
|
-
|
|
73
|
-
controller = Bluepill::Controller.new(options.select { |key, _| %i[base_dir log_file].include?(key) })
|
|
72
|
+
controller = Bluepill::Controller.new(options.slice(:base_dir, :log_file))
|
|
74
73
|
|
|
75
74
|
if controller.running_applications.include?(File.basename($PROGRAM_NAME)) && File.symlink?($PROGRAM_NAME)
|
|
76
75
|
# bluepill was called as a symlink with the name of the target application
|
data/bluepill.gemspec
CHANGED
|
@@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
|
|
|
22
22
|
"rubygems_mfa_required" => "true"
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
spec.required_ruby_version = ">= 2.
|
|
25
|
+
spec.required_ruby_version = ">= 2.5"
|
|
26
26
|
|
|
27
27
|
# sig has the RBS signatures, and the standard libraries they use in manifest.yaml
|
|
28
28
|
spec.executables = %w[bluepill bpsv]
|
data/lib/bluepill/daemonize.rb
CHANGED
|
@@ -52,11 +52,9 @@ module Bluepill
|
|
|
52
52
|
# @api private
|
|
53
53
|
def self.safefork
|
|
54
54
|
loop do
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
sleep 5
|
|
59
|
-
end
|
|
55
|
+
return fork
|
|
56
|
+
rescue Errno::EWOULDBLOCK
|
|
57
|
+
sleep 5
|
|
60
58
|
end
|
|
61
59
|
end
|
|
62
60
|
|
|
@@ -201,11 +199,9 @@ module Bluepill
|
|
|
201
199
|
# @api private
|
|
202
200
|
def self.close_fds
|
|
203
201
|
(3..MAX_FD).each do |fd|
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
nil
|
|
208
|
-
end
|
|
202
|
+
IO.for_fd(fd).close
|
|
203
|
+
rescue
|
|
204
|
+
nil
|
|
209
205
|
end
|
|
210
206
|
end
|
|
211
207
|
|
|
@@ -190,7 +190,7 @@ module Bluepill
|
|
|
190
190
|
# @api private
|
|
191
191
|
def validate_stop_grace_time!(stop_signals, stop_grace_time)
|
|
192
192
|
delays = stop_signals.select.with_index { |_, i| i.odd? }
|
|
193
|
-
return unless stop_grace_time.nil? || stop_grace_time <= delays.
|
|
193
|
+
return unless stop_grace_time.nil? || stop_grace_time <= delays.sum
|
|
194
194
|
|
|
195
195
|
config_error!("Config Error: Stop_grace_time should be greater than the sum of stop_signals delays!")
|
|
196
196
|
end
|
|
@@ -64,12 +64,10 @@ module Bluepill
|
|
|
64
64
|
# @api private
|
|
65
65
|
def notify_triggers(transition)
|
|
66
66
|
triggers.each do |trigger|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
raise
|
|
72
|
-
end
|
|
67
|
+
trigger.notify(transition)
|
|
68
|
+
rescue => e
|
|
69
|
+
logger.err e.backtrace
|
|
70
|
+
raise
|
|
73
71
|
end
|
|
74
72
|
end
|
|
75
73
|
|
|
@@ -71,10 +71,12 @@ module Bluepill
|
|
|
71
71
|
# @api private
|
|
72
72
|
def check?(value)
|
|
73
73
|
return false unless value.is_a?(@kind)
|
|
74
|
-
|
|
74
|
+
|
|
75
|
+
pattern = @pattern
|
|
76
|
+
return true unless pattern
|
|
75
77
|
|
|
76
78
|
response = value #: Net::HTTPResponse
|
|
77
|
-
|
|
79
|
+
pattern.match?(response.body)
|
|
78
80
|
end
|
|
79
81
|
|
|
80
82
|
private
|
|
@@ -189,12 +189,10 @@ module Bluepill
|
|
|
189
189
|
def signal_journaled(signal, ids, kind)
|
|
190
190
|
past, verb = signal.eql?("TERM") ? %w[Termed term] : %w[Killed kill]
|
|
191
191
|
ids.each do |id|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
logger.debug("Unable to #{verb} missing #{kind.label} #{id}")
|
|
197
|
-
end
|
|
192
|
+
::Process.kill(signal, kind.sign * id)
|
|
193
|
+
logger.info("#{past} old #{kind.label} #{id}")
|
|
194
|
+
rescue Errno::ESRCH
|
|
195
|
+
logger.debug("Unable to #{verb} missing #{kind.label} #{id}")
|
|
198
196
|
end
|
|
199
197
|
end
|
|
200
198
|
end
|
data/lib/bluepill/socket.rb
CHANGED
|
@@ -46,12 +46,10 @@ module Bluepill
|
|
|
46
46
|
def self.client_command(base_dir, name, command)
|
|
47
47
|
res = nil
|
|
48
48
|
MAX_ATTEMPTS.times do |current_attempt|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
retry_or_abort(current_attempt)
|
|
54
|
-
end
|
|
49
|
+
res = send_command(base_dir, name, command)
|
|
50
|
+
break
|
|
51
|
+
rescue EOFError, Timeout::Error
|
|
52
|
+
retry_or_abort(current_attempt)
|
|
55
53
|
end
|
|
56
54
|
res
|
|
57
55
|
end
|
data/lib/bluepill/version.rb
CHANGED
|
@@ -4,7 +4,7 @@ module Bluepill
|
|
|
4
4
|
# The version of bluepill
|
|
5
5
|
#
|
|
6
6
|
# @example
|
|
7
|
-
# Bluepill::Version.to_s # => "0.2.
|
|
7
|
+
# Bluepill::Version.to_s # => "0.2.5"
|
|
8
8
|
#
|
|
9
9
|
# @api public
|
|
10
10
|
module Version
|
|
@@ -35,13 +35,13 @@ module Bluepill
|
|
|
35
35
|
# Return the patch version
|
|
36
36
|
#
|
|
37
37
|
# @example
|
|
38
|
-
# Bluepill::Version.patch # =>
|
|
38
|
+
# Bluepill::Version.patch # => 5
|
|
39
39
|
#
|
|
40
40
|
# @return [Integer] the patch version
|
|
41
41
|
#
|
|
42
42
|
# @api public
|
|
43
43
|
def self.patch
|
|
44
|
-
|
|
44
|
+
5
|
|
45
45
|
end
|
|
46
46
|
|
|
47
47
|
# Return the pre-release version
|
|
@@ -58,7 +58,7 @@ module Bluepill
|
|
|
58
58
|
# Return the version's parts by name
|
|
59
59
|
#
|
|
60
60
|
# @example
|
|
61
|
-
# Bluepill::Version.to_h # => {major: 0, minor: 2, patch:
|
|
61
|
+
# Bluepill::Version.to_h # => {major: 0, minor: 2, patch: 5, pre: nil}
|
|
62
62
|
#
|
|
63
63
|
# @return [Hash{Symbol => Integer, nil}] the major, minor, patch and
|
|
64
64
|
# pre-release versions
|
|
@@ -76,7 +76,7 @@ module Bluepill
|
|
|
76
76
|
# Return the version's parts, without a missing pre-release version
|
|
77
77
|
#
|
|
78
78
|
# @example
|
|
79
|
-
# Bluepill::Version.to_a # => [0, 2,
|
|
79
|
+
# Bluepill::Version.to_a # => [0, 2, 5]
|
|
80
80
|
#
|
|
81
81
|
# @return [Array<Integer>] the parts of the version
|
|
82
82
|
#
|
|
@@ -88,9 +88,9 @@ module Bluepill
|
|
|
88
88
|
# Return the version as a string
|
|
89
89
|
#
|
|
90
90
|
# @example
|
|
91
|
-
# Bluepill::Version.to_s # => "0.2.
|
|
91
|
+
# Bluepill::Version.to_s # => "0.2.5"
|
|
92
92
|
#
|
|
93
|
-
# @return [String] the version, such as "0.2.
|
|
93
|
+
# @return [String] the version, such as "0.2.5"
|
|
94
94
|
#
|
|
95
95
|
# @api public
|
|
96
96
|
def self.to_s
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: bluepill
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Arya Asemanfar
|
|
@@ -116,7 +116,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
116
116
|
requirements:
|
|
117
117
|
- - ">="
|
|
118
118
|
- !ruby/object:Gem::Version
|
|
119
|
-
version: '2.
|
|
119
|
+
version: '2.5'
|
|
120
120
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
121
121
|
requirements:
|
|
122
122
|
- - ">="
|