eye 0.6 → 0.6.1
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 +8 -8
- data/.gitignore +1 -1
- data/CHANGES.md +6 -0
- data/bin/loader_eye +3 -1
- data/lib/eye.rb +1 -1
- data/lib/eye/controller/helpers.rb +1 -1
- data/lib/eye/dsl/opts.rb +1 -1
- data/lib/eye/process/config.rb +1 -0
- data/lib/eye/process/validate.rb +11 -1
- data/lib/eye/system.rb +2 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MGE3MGMyMzNhZDBlYmQ5ZTdmYWEyMDMxODljMTgzODRlOGJjNzY5Nw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NDY3NTA4MzliNzZjN2ZkYTg1OGM4OGIwODk3NWRkYzJlOWE3MzM3Yg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZTM4ZTdkZmI2ZGViN2JlYjZmZjg0NmUyOTFjZWY1OGMyOGQ5NTEwMDY0Yjg0
|
10
|
+
MDdjMmJkMTI1ZTU2NDk4MjFjMjBlYTRmZWI5NzMwMTU1M2YzZTM3M2I1YzQx
|
11
|
+
OWQyMzYwMjliODM5YmVjM2RhMmY2MTgzYzZhYjBjZWRjNmJmOTg=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ODVjMTcyZGFlZTQyNzczMWM2MDU2MWU4Mzc0NDI0MzBlZGRmNzNkYjQyNTQ2
|
14
|
+
ZWExZjcyMTVjYjUxNTc4MDY4Yjc3YTliZTQ4MmU1ZDdmMWNkOTUxYTVlOGQx
|
15
|
+
ODliODNkY2Q5ZTNlNzA1N2FlZjhiOGVlNWQ0MzlhN2E2MzFiZjY=
|
data/.gitignore
CHANGED
data/CHANGES.md
CHANGED
data/bin/loader_eye
CHANGED
@@ -63,7 +63,9 @@ server.async.run
|
|
63
63
|
|
64
64
|
trap("USR1") { Eye::Logger.reopen }
|
65
65
|
trap("USR2") { GC.start }
|
66
|
-
trap("INT") { exit }
|
66
|
+
trap("INT") { Eye::Logger.info("INT signal <#{$$}>"); exit }
|
67
|
+
trap("QUIT") { Eye::Logger.info("QUIT signal <#{$$}>"); exit }
|
68
|
+
trap("TERM") { Eye::Logger.info("TERM signal <#{$$}>"); exit }
|
67
69
|
|
68
70
|
at_exit { Eye::Control.command(:stop_all) } if options[:stop_all]
|
69
71
|
|
data/lib/eye.rb
CHANGED
@@ -4,7 +4,7 @@ module Eye::Controller::Helpers
|
|
4
4
|
str = Eye::PROCLINE
|
5
5
|
str += " [#{@applications.map(&:name) * ', '}]" if @applications.present?
|
6
6
|
str += " (v #{ENV['EYE_V']})" if ENV['EYE_V']
|
7
|
-
str += " (in #{Eye::Local.dir})"
|
7
|
+
str += " (in #{Eye::Local.dir})"
|
8
8
|
$0 = str
|
9
9
|
end
|
10
10
|
|
data/lib/eye/dsl/opts.rb
CHANGED
@@ -4,7 +4,7 @@ class Eye::Dsl::Opts < Eye::Dsl::PureOpts
|
|
4
4
|
:stop_command, :restart_command, :uid, :gid ]
|
5
5
|
create_options_methods(STR_OPTIONS, String)
|
6
6
|
|
7
|
-
BOOL_OPTIONS = [ :daemonize, :keep_alive, :auto_start, :stop_on_delete, :clear_pid, :preserve_fds, :use_leaf_child ]
|
7
|
+
BOOL_OPTIONS = [ :daemonize, :keep_alive, :auto_start, :stop_on_delete, :clear_pid, :preserve_fds, :use_leaf_child, :clear_env ]
|
8
8
|
create_options_methods(BOOL_OPTIONS, [TrueClass, FalseClass])
|
9
9
|
|
10
10
|
INTERVAL_OPTIONS = [ :check_alive_period, :start_timeout, :restart_timeout, :stop_timeout, :start_grace,
|
data/lib/eye/process/config.rb
CHANGED
@@ -37,6 +37,7 @@ module Eye::Process::Config
|
|
37
37
|
|
38
38
|
h[:stdout] = Eye::System.normalized_file(h[:stdout], h[:working_dir]) if h[:stdout]
|
39
39
|
h[:stderr] = Eye::System.normalized_file(h[:stderr], h[:working_dir]) if h[:stderr]
|
40
|
+
h[:stdall] = Eye::System.normalized_file(h[:stdall], h[:working_dir]) if h[:stdall]
|
40
41
|
|
41
42
|
h[:environment] = Eye::System.prepare_env(h)
|
42
43
|
|
data/lib/eye/process/validate.rb
CHANGED
@@ -22,12 +22,22 @@ module Eye::Process::Validate
|
|
22
22
|
|
23
23
|
if localize
|
24
24
|
Etc.getpwnam(config[:uid]) if config[:uid]
|
25
|
-
Etc.
|
25
|
+
Etc.getgrnam(config[:gid]) if config[:gid]
|
26
26
|
|
27
27
|
if config[:working_dir]
|
28
28
|
raise Error, "working_dir '#{config[:working_dir]}' is invalid" unless File.directory?(config[:working_dir])
|
29
29
|
end
|
30
30
|
end
|
31
|
+
|
32
|
+
if config[:stop_signals]
|
33
|
+
s = config[:stop_signals].clone
|
34
|
+
while s.present?
|
35
|
+
sig = s.shift
|
36
|
+
timeout = s.shift
|
37
|
+
raise Error, "signal should be String, Symbol, Fixnum, not #{sig.inspect}" if sig && ![String, Symbol, Fixnum].include?(sig.class)
|
38
|
+
raise Error, "signal sleep should be Numeric, not #{timeout.inspect}" if timeout && ![Fixnum, Float].include?(timeout.class)
|
39
|
+
end
|
40
|
+
end
|
31
41
|
end
|
32
42
|
|
33
43
|
end
|
data/lib/eye/system.rb
CHANGED
@@ -115,10 +115,11 @@ module Eye::System
|
|
115
115
|
options[:in] = config[:stdin] if config[:stdin]
|
116
116
|
options[:umask] = config[:umask] if config[:umask]
|
117
117
|
options[:close_others] = false if config[:preserve_fds]
|
118
|
+
options[:unsetenv_others] = true if config[:clear_env]
|
118
119
|
|
119
120
|
if Eye::Local.root?
|
120
121
|
options[:uid] = Etc.getpwnam(config[:uid]).uid if config[:uid]
|
121
|
-
options[:gid] = Etc.
|
122
|
+
options[:gid] = Etc.getgrnam(config[:gid]).gid if config[:gid]
|
122
123
|
end
|
123
124
|
|
124
125
|
options
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eye
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 0.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Konstantin Makarchev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-06-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: celluloid
|