runit-man 2.3.16 → 2.3.17

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,3 @@
1
+ %template testsv_format, "%msg%\n"
2
+ $template testsv_file, "/var/log/testsv/%$NOW%/%programname%.log"
3
+ if $syslogfacility-text == 'local1' and $programname contains 'testsv' then ?testsv_file;testsv_format
@@ -0,0 +1,58 @@
1
+ #!/usr/bin/env ruby
2
+ # encoding: utf-8
3
+
4
+ require 'rubygems'
5
+ require 'syslogger'
6
+
7
+ class Runner
8
+ attr_accessor :nextnr, :children
9
+
10
+ def initialize
11
+ @terminate = false
12
+ self.nextnr = 1
13
+ self.children = []
14
+ end
15
+
16
+ def create_child
17
+ nr = nextnr
18
+ self.nextnr += 1
19
+ pid = fork do
20
+ logger = Syslogger.new("testsv#{nr}", Syslog::LOG_PID, Syslog::LOG_LOCAL1)
21
+ loop do
22
+ logger.info "You from worker #{nr}"
23
+ sleep 5
24
+ end
25
+ end
26
+ children << pid
27
+ end
28
+
29
+ def terminate!
30
+ @terminate = true
31
+ end
32
+
33
+ def terminate?
34
+ !! @terminate
35
+ end
36
+
37
+ def run
38
+ 10.times { create_child }
39
+ until terminate?
40
+ child_pid = Process.wait(-1, Process::WNOHANG)
41
+ if child_pid
42
+ children.delete_if { |pid| pid == child_pid }
43
+ create_child
44
+ else
45
+ sleep 1
46
+ end
47
+ end
48
+ children.each { |pid| Process.kill('TERM', pid) }
49
+ end
50
+ end
51
+
52
+ runner = Runner.new
53
+
54
+ Signal.trap('TERM') do
55
+ runner.terminate!
56
+ end
57
+
58
+ runner.run
@@ -0,0 +1,6 @@
1
+ #!/bin/bash
2
+ exec 2>&1
3
+ source /usr/local/rvm/scripts/rvm
4
+ source ~/.rvm/scripts/rvm
5
+
6
+ exec ./rubyscript.rb
@@ -14,9 +14,9 @@ class ServiceInfo::Logger < ServiceInfo::Base
14
14
  r = []
15
15
  dir_name = File.dirname(File.dirname(log_file_location))
16
16
  Dir.foreach(dir_name) do |name|
17
- next if ServiceInfo.itself_or_parent?(name)
17
+ next if ServiceInfo::Base.itself_or_parent?(name)
18
18
  full_name = File.expand_path(name, dir_name)
19
- next unless File.directory?(full_name)
19
+ next unless File.directory?(full_name)
20
20
  file_name = File.join(full_name, "#{self.name}.log")
21
21
  label = "#{Utils.host_name}-#{self.name}-#{name}.log"
22
22
  unless File.exists?(file_name)
@@ -12,8 +12,8 @@ class ServiceInfo::Svlogd < ServiceInfo::Base
12
12
  r = []
13
13
  dir_name = File.dirname(log_file_location)
14
14
  Dir.foreach(dir_name) do |name|
15
- next if ServiceInfo.itself_or_parent?(name)
16
- next if SPECIAL_LOG_FILES.include?(name)
15
+ next if ServiceInfo::Base.itself_or_parent?(name)
16
+ next if SPECIAL_LOG_FILES.include?(name)
17
17
  full_name = File.expand_path(name, dir_name)
18
18
  stats = File.stat(full_name)
19
19
  stat_times = [stats.ctime.utc, stats.atime.utc, stats.mtime.utc]
@@ -1,4 +1,4 @@
1
1
  class RunitMan
2
- VERSION = '2.3.16'.freeze
2
+ VERSION = '2.3.17'.freeze
3
3
  end
4
4
 
metadata CHANGED
@@ -1,168 +1,225 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: runit-man
3
- version: !ruby/object:Gem::Version
4
- version: 2.3.16
5
- prerelease:
3
+ version: !ruby/object:Gem::Version
4
+ hash: 33
5
+ prerelease: false
6
+ segments:
7
+ - 2
8
+ - 3
9
+ - 17
10
+ version: 2.3.17
6
11
  platform: ruby
7
- authors:
12
+ authors:
8
13
  - Akzhan Abdulin
9
14
  autorequire:
10
15
  bindir: bin
11
16
  cert_chain: []
12
- date: 2011-11-25 00:00:00.000000000 Z
13
- dependencies:
14
- - !ruby/object:Gem::Dependency
15
- name: yajl-ruby
16
- requirement: &2157490420 !ruby/object:Gem::Requirement
17
+
18
+ date: 2012-02-07 00:00:00 +04:00
19
+ default_executable:
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
22
+ version_requirements: &id001 !ruby/object:Gem::Requirement
17
23
  none: false
18
- requirements:
24
+ requirements:
19
25
  - - ~>
20
- - !ruby/object:Gem::Version
21
- version: '1.0'
22
- type: :runtime
26
+ - !ruby/object:Gem::Version
27
+ hash: 15
28
+ segments:
29
+ - 1
30
+ - 0
31
+ version: "1.0"
32
+ requirement: *id001
33
+ name: yajl-ruby
23
34
  prerelease: false
24
- version_requirements: *2157490420
25
- - !ruby/object:Gem::Dependency
26
- name: haml
27
- requirement: &2157489300 !ruby/object:Gem::Requirement
35
+ type: :runtime
36
+ - !ruby/object:Gem::Dependency
37
+ version_requirements: &id002 !ruby/object:Gem::Requirement
28
38
  none: false
29
- requirements:
39
+ requirements:
30
40
  - - ~>
31
- - !ruby/object:Gem::Version
32
- version: '3.0'
33
- type: :runtime
41
+ - !ruby/object:Gem::Version
42
+ hash: 7
43
+ segments:
44
+ - 3
45
+ - 0
46
+ version: "3.0"
47
+ requirement: *id002
48
+ name: haml
34
49
  prerelease: false
35
- version_requirements: *2157489300
36
- - !ruby/object:Gem::Dependency
37
- name: sinatra
38
- requirement: &2157488520 !ruby/object:Gem::Requirement
50
+ type: :runtime
51
+ - !ruby/object:Gem::Dependency
52
+ version_requirements: &id003 !ruby/object:Gem::Requirement
39
53
  none: false
40
- requirements:
54
+ requirements:
41
55
  - - ~>
42
- - !ruby/object:Gem::Version
43
- version: '1.3'
44
- type: :runtime
56
+ - !ruby/object:Gem::Version
57
+ hash: 9
58
+ segments:
59
+ - 1
60
+ - 3
61
+ version: "1.3"
62
+ requirement: *id003
63
+ name: sinatra
45
64
  prerelease: false
46
- version_requirements: *2157488520
47
- - !ruby/object:Gem::Dependency
48
- name: sinatra-content-for2
49
- requirement: &2157487020 !ruby/object:Gem::Requirement
65
+ type: :runtime
66
+ - !ruby/object:Gem::Dependency
67
+ version_requirements: &id004 !ruby/object:Gem::Requirement
50
68
  none: false
51
- requirements:
69
+ requirements:
52
70
  - - ~>
53
- - !ruby/object:Gem::Version
71
+ - !ruby/object:Gem::Version
72
+ hash: 31
73
+ segments:
74
+ - 0
75
+ - 2
76
+ - 4
54
77
  version: 0.2.4
55
- type: :runtime
78
+ requirement: *id004
79
+ name: sinatra-content-for2
56
80
  prerelease: false
57
- version_requirements: *2157487020
58
- - !ruby/object:Gem::Dependency
59
- name: i18n
60
- requirement: &2157485720 !ruby/object:Gem::Requirement
81
+ type: :runtime
82
+ - !ruby/object:Gem::Dependency
83
+ version_requirements: &id005 !ruby/object:Gem::Requirement
61
84
  none: false
62
- requirements:
85
+ requirements:
63
86
  - - ~>
64
- - !ruby/object:Gem::Version
65
- version: '0.5'
66
- type: :runtime
87
+ - !ruby/object:Gem::Version
88
+ hash: 1
89
+ segments:
90
+ - 0
91
+ - 5
92
+ version: "0.5"
93
+ requirement: *id005
94
+ name: i18n
67
95
  prerelease: false
68
- version_requirements: *2157485720
69
- - !ruby/object:Gem::Dependency
70
- name: file-tail
71
- requirement: &2157485060 !ruby/object:Gem::Requirement
96
+ type: :runtime
97
+ - !ruby/object:Gem::Dependency
98
+ version_requirements: &id006 !ruby/object:Gem::Requirement
72
99
  none: false
73
- requirements:
100
+ requirements:
74
101
  - - ~>
75
- - !ruby/object:Gem::Version
102
+ - !ruby/object:Gem::Version
103
+ hash: 25
104
+ segments:
105
+ - 1
106
+ - 0
107
+ - 7
76
108
  version: 1.0.7
77
- type: :runtime
109
+ requirement: *id006
110
+ name: file-tail
78
111
  prerelease: false
79
- version_requirements: *2157485060
80
- - !ruby/object:Gem::Dependency
81
- name: rake
82
- requirement: &2157484260 !ruby/object:Gem::Requirement
112
+ type: :runtime
113
+ - !ruby/object:Gem::Dependency
114
+ version_requirements: &id007 !ruby/object:Gem::Requirement
83
115
  none: false
84
- requirements:
116
+ requirements:
85
117
  - - ~>
86
- - !ruby/object:Gem::Version
87
- version: '0.8'
88
- - - ! '!='
89
- - !ruby/object:Gem::Version
118
+ - !ruby/object:Gem::Version
119
+ hash: 27
120
+ segments:
121
+ - 0
122
+ - 8
123
+ version: "0.8"
124
+ - - "!="
125
+ - !ruby/object:Gem::Version
126
+ hash: 59
127
+ segments:
128
+ - 0
129
+ - 9
130
+ - 0
90
131
  version: 0.9.0
91
- type: :development
132
+ requirement: *id007
133
+ name: rake
92
134
  prerelease: false
93
- version_requirements: *2157484260
94
- - !ruby/object:Gem::Dependency
95
- name: rspec-core
96
- requirement: &2157470300 !ruby/object:Gem::Requirement
97
- none: false
98
- requirements:
99
- - - ! '>='
100
- - !ruby/object:Gem::Version
101
- version: '0'
102
135
  type: :development
103
- prerelease: false
104
- version_requirements: *2157470300
105
- - !ruby/object:Gem::Dependency
106
- name: rspec-expectations
107
- requirement: &2157468360 !ruby/object:Gem::Requirement
136
+ - !ruby/object:Gem::Dependency
137
+ version_requirements: &id008 !ruby/object:Gem::Requirement
108
138
  none: false
109
- requirements:
110
- - - ! '>='
111
- - !ruby/object:Gem::Version
112
- version: '0'
113
- type: :development
139
+ requirements:
140
+ - - ">="
141
+ - !ruby/object:Gem::Version
142
+ hash: 3
143
+ segments:
144
+ - 0
145
+ version: "0"
146
+ requirement: *id008
147
+ name: rspec-core
114
148
  prerelease: false
115
- version_requirements: *2157468360
116
- - !ruby/object:Gem::Dependency
117
- name: rr
118
- requirement: &2157467760 !ruby/object:Gem::Requirement
119
- none: false
120
- requirements:
121
- - - ! '>='
122
- - !ruby/object:Gem::Version
123
- version: '0'
124
149
  type: :development
150
+ - !ruby/object:Gem::Dependency
151
+ version_requirements: &id009 !ruby/object:Gem::Requirement
152
+ none: false
153
+ requirements:
154
+ - - ">="
155
+ - !ruby/object:Gem::Version
156
+ hash: 3
157
+ segments:
158
+ - 0
159
+ version: "0"
160
+ requirement: *id009
161
+ name: rspec-expectations
125
162
  prerelease: false
126
- version_requirements: *2157467760
127
- - !ruby/object:Gem::Dependency
128
- name: rack-test
129
- requirement: &2157467120 !ruby/object:Gem::Requirement
163
+ type: :development
164
+ - !ruby/object:Gem::Dependency
165
+ version_requirements: &id010 !ruby/object:Gem::Requirement
130
166
  none: false
131
- requirements:
132
- - - ! '>='
133
- - !ruby/object:Gem::Version
134
- version: '0'
167
+ requirements:
168
+ - - ">="
169
+ - !ruby/object:Gem::Version
170
+ hash: 3
171
+ segments:
172
+ - 0
173
+ version: "0"
174
+ requirement: *id010
175
+ name: rr
176
+ prerelease: false
135
177
  type: :development
178
+ - !ruby/object:Gem::Dependency
179
+ version_requirements: &id011 !ruby/object:Gem::Requirement
180
+ none: false
181
+ requirements:
182
+ - - ">="
183
+ - !ruby/object:Gem::Version
184
+ hash: 3
185
+ segments:
186
+ - 0
187
+ version: "0"
188
+ requirement: *id011
189
+ name: rack-test
136
190
  prerelease: false
137
- version_requirements: *2157467120
138
- - !ruby/object:Gem::Dependency
139
- name: bundler
140
- requirement: &2157466320 !ruby/object:Gem::Requirement
191
+ type: :development
192
+ - !ruby/object:Gem::Dependency
193
+ version_requirements: &id012 !ruby/object:Gem::Requirement
141
194
  none: false
142
- requirements:
195
+ requirements:
143
196
  - - ~>
144
- - !ruby/object:Gem::Version
197
+ - !ruby/object:Gem::Version
198
+ hash: 3
199
+ segments:
200
+ - 1
201
+ - 0
202
+ - 10
145
203
  version: 1.0.10
146
- type: :development
204
+ requirement: *id012
205
+ name: bundler
147
206
  prerelease: false
148
- version_requirements: *2157466320
149
- description: ! 'Simple runit (http://smarden.org/runit/) web management tool with
150
- i18n.
151
-
152
-
207
+ type: :development
208
+ description: |
209
+ Simple runit (http://smarden.org/runit/) web management tool with i18n.
210
+
153
211
  Server will run by runit-man script.
154
-
155
-
212
+
156
213
  More information available at https://github.com/Undev/runit-man
157
214
 
158
- '
159
215
  email: akzhan.abdulin@gmail.com
160
- executables:
216
+ executables:
161
217
  - runit-man
162
218
  extensions: []
163
- extra_rdoc_files:
219
+
220
+ extra_rdoc_files:
164
221
  - README.markdown
165
- files:
222
+ files:
166
223
  - .gitignore
167
224
  - CHANGELOG.markdown
168
225
  - DESCRIPTION
@@ -173,6 +230,9 @@ files:
173
230
  - README_ru.markdown
174
231
  - Rakefile
175
232
  - bin/runit-man
233
+ - goodies/rsyslog-config-for-multiple-logs-of-test-service.conf
234
+ - goodies/test-service-for-logger-with-multiple-logs/rubyscript.rb
235
+ - goodies/test-service-for-logger-with-multiple-logs/run
176
236
  - i18n/en.yml
177
237
  - i18n/ru.yml
178
238
  - lib/runit-man/app.rb
@@ -215,37 +275,40 @@ files:
215
275
  - views/log.haml
216
276
  - views/log_downloads.haml
217
277
  - views/view_file.haml
278
+ has_rdoc: true
218
279
  homepage: https://github.com/Undev/runit-man
219
280
  licenses: []
281
+
220
282
  post_install_message:
221
283
  rdoc_options: []
222
- require_paths:
284
+
285
+ require_paths:
223
286
  - lib
224
- required_ruby_version: !ruby/object:Gem::Requirement
287
+ required_ruby_version: !ruby/object:Gem::Requirement
225
288
  none: false
226
- requirements:
227
- - - ! '>='
228
- - !ruby/object:Gem::Version
229
- version: '0'
230
- segments:
289
+ requirements:
290
+ - - ">="
291
+ - !ruby/object:Gem::Version
292
+ hash: 3
293
+ segments:
231
294
  - 0
232
- hash: -118617106794587710
233
- required_rubygems_version: !ruby/object:Gem::Requirement
295
+ version: "0"
296
+ required_rubygems_version: !ruby/object:Gem::Requirement
234
297
  none: false
235
- requirements:
236
- - - ! '>='
237
- - !ruby/object:Gem::Version
238
- version: '0'
239
- segments:
298
+ requirements:
299
+ - - ">="
300
+ - !ruby/object:Gem::Version
301
+ hash: 3
302
+ segments:
240
303
  - 0
241
- hash: -118617106794587710
242
- requirements:
304
+ version: "0"
305
+ requirements:
243
306
  - none
244
307
  rubyforge_project:
245
- rubygems_version: 1.8.10
308
+ rubygems_version: 1.3.7
246
309
  signing_key:
247
310
  specification_version: 3
248
311
  summary: Runit web management tool.
249
- test_files:
312
+ test_files:
250
313
  - spec/functional/runit-man_spec.rb
251
314
  - spec/spec_helper.rb