eye 0.6 → 0.6.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YTRhNjdkYTZkYmFlMmJmNGJmMGUzNWM4N2ViZjAyOWZiODhiOThkNA==
4
+ MGE3MGMyMzNhZDBlYmQ5ZTdmYWEyMDMxODljMTgzODRlOGJjNzY5Nw==
5
5
  data.tar.gz: !binary |-
6
- MzFiZDcwZjM4NTg4Y2QwNDI4NjgxZmU4MGQxZjEzMzQxYmJiZDY5Mw==
6
+ NDY3NTA4MzliNzZjN2ZkYTg1OGM4OGIwODk3NWRkYzJlOWE3MzM3Yg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- Zjk2MzM3ODlmMTA4ZTE4OTUzNTJkMTY3YzEzNTY5ZGM1ZmI4YWYzYjFiMjJk
10
- N2RmMzJmNWE1ZDcyNzkyYmE1ZDhlNjM1ZTcxNzFmMmRlZmQ5YTVlNDE3NzNm
11
- MGNlNmQwZDc1MzNjN2JlYzFjNWI5MDgyYWNmZDYyMjc0ZDRiNTE=
9
+ ZTM4ZTdkZmI2ZGViN2JlYjZmZjg0NmUyOTFjZWY1OGMyOGQ5NTEwMDY0Yjg0
10
+ MDdjMmJkMTI1ZTU2NDk4MjFjMjBlYTRmZWI5NzMwMTU1M2YzZTM3M2I1YzQx
11
+ OWQyMzYwMjliODM5YmVjM2RhMmY2MTgzYzZhYjBjZWRjNmJmOTg=
12
12
  data.tar.gz: !binary |-
13
- MzRkYjE1M2FhN2Q4YmQyMDk0Y2Q3ZjYxN2Y2YmQwYTMwODM5YmJjMzI3Nzlh
14
- NTFmMjA2MTc1OTk2ODA4Y2FkZjRjYTMwZGNlNmEyYWMzYTJlMTJiYmI4Y2Iw
15
- YmQyODZjMzVlMzliZWNmNzVjNDAxZGU5YTM4YmVkNmRiMmJiY2M=
13
+ ODVjMTcyZGFlZTQyNzczMWM2MDU2MWU4Mzc0NDI0MzBlZGRmNzNkYjQyNTQ2
14
+ ZWExZjcyMTVjYjUxNTc4MDY4Yjc3YTliZTQ4MmU1ZDdmMWNkOTUxYTVlOGQx
15
+ ODliODNkY2Q5ZTNlNzA1N2FlZjhiOGVlNWQ0MzlhN2E2MzFiZjY=
data/.gitignore CHANGED
@@ -35,4 +35,4 @@ script
35
35
  *.cache
36
36
  *.tmp
37
37
  /vendor/
38
-
38
+ *.gz
data/CHANGES.md CHANGED
@@ -1,3 +1,9 @@
1
+ 0.6.1
2
+ ------
3
+ * Add log rotation gem (https://github.com/kostya/eye-rotate)
4
+ * Add option to clear environment variables #64
5
+ * Get group names from /etc/group via Etc#getgrnam #63
6
+
1
7
  0.6
2
8
  ------
3
9
  * add processes dependencies (#43)
@@ -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
@@ -1,5 +1,5 @@
1
1
  module Eye
2
- VERSION = "0.6"
2
+ VERSION = "0.6.1"
3
3
  ABOUT = "Eye v#{VERSION} (c) 2012-2014 @kostya"
4
4
  PROCLINE = "eye monitoring v#{VERSION}"
5
5
 
@@ -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})" if Eye::Local.local_runner
7
+ str += " (in #{Eye::Local.dir})"
8
8
  $0 = str
9
9
  end
10
10
 
@@ -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,
@@ -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
 
@@ -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.getpwnam(config[:gid]) if config[:gid]
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
@@ -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.getpwnam(config[:gid]).gid if config[:gid]
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: '0.6'
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-05-18 00:00:00.000000000 Z
11
+ date: 2014-06-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: celluloid