abalone 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/abalone/watchdog.rb +7 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 99e3ba0b7f1be795f752b36cde2e1af308049947
|
4
|
+
data.tar.gz: 4cfc92d70133c647cd3809d5301694cc122d9f1d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b3184517b2d47cda52d4bfa6c982118ff548f7a7f2e43d73346193710c66f73d7d7b60d5cf5f4abdb834d459df3234ab004919940799efe96661cde89e7ff094
|
7
|
+
data.tar.gz: d57978c06364f95f3bbbef3aedbc669f52736096210a6b5f130dee138e712eeca1b648c75ee0bb015a29189cdf77ac235f550e235fa465b708d61f72d347286e
|
data/lib/abalone/watchdog.rb
CHANGED
@@ -3,6 +3,11 @@ class Abalone::Watchdog
|
|
3
3
|
raise 'Watchdog needs a port to be set' unless options.include? :port
|
4
4
|
raise 'Watchdog needs a logger to be set' unless options.include? :logger
|
5
5
|
logger = options[:logger]
|
6
|
+
pid = Process.pid
|
7
|
+
socket = Socket.new(Socket::AF_UNIX, Socket::SOCK_DGRAM, 0).tap do |socket|
|
8
|
+
socket.connect(Socket.pack_sockaddr_un(ENV['NOTIFY_SOCKET']))
|
9
|
+
socket.close_on_exec = true
|
10
|
+
end
|
6
11
|
|
7
12
|
Thread.new do
|
8
13
|
require 'net/http'
|
@@ -17,7 +22,8 @@ class Abalone::Watchdog
|
|
17
22
|
http.start
|
18
23
|
http.request_get('/heartbeat/ping') do |res|
|
19
24
|
logger.debug "Heartbeat response: #{res.read_body}"
|
20
|
-
system('systemd-notify WATCHDOG=1')
|
25
|
+
#system('systemd-notify WATCHDOG=1')
|
26
|
+
socket.write("WATCHDOG=1\nMAINPID=#{pid}")
|
21
27
|
end
|
22
28
|
rescue => e
|
23
29
|
logger.warn 'Abalone service failed heartbeat check!'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: abalone
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Ford
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-09-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sinatra
|
@@ -49,14 +49,13 @@ executables:
|
|
49
49
|
extensions: []
|
50
50
|
extra_rdoc_files: []
|
51
51
|
files:
|
52
|
-
- README.md
|
53
52
|
- LICENSE
|
53
|
+
- README.md
|
54
54
|
- bin/abalone
|
55
|
+
- lib/abalone.rb
|
55
56
|
- lib/abalone/buffer.rb
|
56
57
|
- lib/abalone/terminal.rb
|
57
58
|
- lib/abalone/watchdog.rb
|
58
|
-
- lib/abalone.rb
|
59
|
-
- views/index.erb
|
60
59
|
- public/css/gear.full.png
|
61
60
|
- public/css/gear.png
|
62
61
|
- public/css/launcher.css
|
@@ -65,6 +64,7 @@ files:
|
|
65
64
|
- public/js/abalone.js
|
66
65
|
- public/js/hterm_all.js
|
67
66
|
- public/js/launcher.js
|
67
|
+
- views/index.erb
|
68
68
|
homepage: https://github.com/binford2k/abalone/
|
69
69
|
licenses:
|
70
70
|
- Apache-2.0
|
@@ -85,7 +85,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
85
85
|
version: '0'
|
86
86
|
requirements: []
|
87
87
|
rubyforge_project:
|
88
|
-
rubygems_version: 2.
|
88
|
+
rubygems_version: 2.5.2
|
89
89
|
signing_key:
|
90
90
|
specification_version: 4
|
91
91
|
summary: Simple Sinatra based web terminal.
|