tyrantmanager 1.2.1 → 1.3.0
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.
- data/HISTORY.rdoc +5 -0
- data/gemspec.rb +4 -3
- data/lib/tyrant_manager/cli.rb +9 -9
- data/lib/tyrant_manager/tyrant_instance.rb +27 -2
- data/lib/tyrant_manager/version.rb +2 -2
- data/tasks/distribution.rake +8 -1
- data/tasks/gemcutter.rake +18 -0
- metadata +19 -8
data/HISTORY.rdoc
CHANGED
data/gemspec.rb
CHANGED
@@ -22,12 +22,13 @@ TyrantManager::GEM_SPEC = Gem::Specification.new do |spec|
|
|
22
22
|
# add dependencies here
|
23
23
|
spec.add_dependency( "loquacious", "~> 1.3.0")
|
24
24
|
spec.add_dependency( "rufus-tokyo", "~> 1.0.0")
|
25
|
-
spec.add_dependency( "logging", "~> 1.
|
26
|
-
spec.add_dependency( "main", "~> 2.
|
25
|
+
spec.add_dependency( "logging", "~> 1.2.2" )
|
26
|
+
spec.add_dependency( "main", "~> 2.9.3" )
|
27
27
|
|
28
28
|
# development dependencies
|
29
|
-
spec.add_development_dependency("configuration", "
|
29
|
+
spec.add_development_dependency("configuration", "~> 1.1.0")
|
30
30
|
spec.add_development_dependency( "rake", "~> 0.8.3")
|
31
|
+
spec.add_development_dependency( "gemcutter", "~> 0.1.4")
|
31
32
|
|
32
33
|
if ext_conf = Configuration.for_if_exist?("extension") then
|
33
34
|
spec.extensions << ext_conf.configs
|
data/lib/tyrant_manager/cli.rb
CHANGED
@@ -19,7 +19,7 @@ class TyrantManager
|
|
19
19
|
argument( :home ) {
|
20
20
|
description "The home directory of the tyrant manager"
|
21
21
|
required
|
22
|
-
default TyrantManager.default_or_home_directory
|
22
|
+
default ::TyrantManager.default_or_home_directory
|
23
23
|
}
|
24
24
|
|
25
25
|
run {
|
@@ -44,7 +44,7 @@ class TyrantManager
|
|
44
44
|
mixin :option_home
|
45
45
|
mixin :option_log_level
|
46
46
|
|
47
|
-
run { Cli.run_command_with_params( "create-instance", params ) }
|
47
|
+
run { ::TyrantManager::Cli.run_command_with_params( "create-instance", params ) }
|
48
48
|
}
|
49
49
|
|
50
50
|
mode( 'start' ) {
|
@@ -57,7 +57,7 @@ class TyrantManager
|
|
57
57
|
default false
|
58
58
|
}
|
59
59
|
|
60
|
-
run { Cli.run_command_with_params( 'start', params ) }
|
60
|
+
run { ::TyrantManager::Cli.run_command_with_params( 'start', params ) }
|
61
61
|
}
|
62
62
|
|
63
63
|
|
@@ -67,7 +67,7 @@ class TyrantManager
|
|
67
67
|
mixin :option_log_level
|
68
68
|
mixin :argument_instances
|
69
69
|
|
70
|
-
run { Cli.run_command_with_params( 'stop', params ) }
|
70
|
+
run { ::TyrantManager::Cli.run_command_with_params( 'stop', params ) }
|
71
71
|
}
|
72
72
|
|
73
73
|
mode('replication-status') {
|
@@ -75,7 +75,7 @@ class TyrantManager
|
|
75
75
|
mixin :option_home
|
76
76
|
mixin :option_log_level
|
77
77
|
mixin :argument_instances
|
78
|
-
run { Cli.run_command_with_params( 'replication-status', params ) }
|
78
|
+
run { ::TyrantManager::Cli.run_command_with_params( 'replication-status', params ) }
|
79
79
|
}
|
80
80
|
|
81
81
|
mode('process-status') {
|
@@ -85,7 +85,7 @@ class TyrantManager
|
|
85
85
|
|
86
86
|
mixin :argument_instances
|
87
87
|
|
88
|
-
run { Cli.run_command_with_params( 'process-status', params ) }
|
88
|
+
run { ::TyrantManager::Cli.run_command_with_params( 'process-status', params ) }
|
89
89
|
}
|
90
90
|
|
91
91
|
mode( 'stats' ) {
|
@@ -95,7 +95,7 @@ class TyrantManager
|
|
95
95
|
|
96
96
|
mixin :argument_instances
|
97
97
|
|
98
|
-
run { Cli.run_command_with_params( 'stats', params ) }
|
98
|
+
run { ::TyrantManager::Cli.run_command_with_params( 'stats', params ) }
|
99
99
|
}
|
100
100
|
|
101
101
|
|
@@ -104,7 +104,7 @@ class TyrantManager
|
|
104
104
|
mixin :option_home
|
105
105
|
mixin :option_log_level
|
106
106
|
mixin :argument_instances
|
107
|
-
run { Cli.run_command_with_params( 'list', params ) }
|
107
|
+
run { ::TyrantManager::Cli.run_command_with_params( 'list', params ) }
|
108
108
|
}
|
109
109
|
|
110
110
|
#--- Mixins ---
|
@@ -113,7 +113,7 @@ class TyrantManager
|
|
113
113
|
description "The home directory of the tyrant manager"
|
114
114
|
argument :required
|
115
115
|
validate { |v| ::File.directory?( v ) }
|
116
|
-
default TyrantManager.default_or_home_directory
|
116
|
+
default ::TyrantManager.default_or_home_directory
|
117
117
|
end
|
118
118
|
end
|
119
119
|
|
@@ -289,7 +289,16 @@ class TyrantManager
|
|
289
289
|
#
|
290
290
|
def start
|
291
291
|
o = %x[ #{start_command} ]
|
292
|
-
|
292
|
+
o.strip!
|
293
|
+
logger.info o if o.length > 0
|
294
|
+
3.times do |x|
|
295
|
+
if self.running? then
|
296
|
+
logger.info "#{self.name} is running as pid #{self.pid}"
|
297
|
+
break
|
298
|
+
else
|
299
|
+
sleep 0.25
|
300
|
+
end
|
301
|
+
end
|
293
302
|
end
|
294
303
|
|
295
304
|
#
|
@@ -304,7 +313,8 @@ class TyrantManager
|
|
304
313
|
logger.info "Process #{_pid} is beyond my control"
|
305
314
|
rescue Errno::ESRCH
|
306
315
|
logger.info "Process #{_pid} is dead"
|
307
|
-
|
316
|
+
cleanup_pid_file
|
317
|
+
rescue => e
|
308
318
|
logger.error "Problem sending kill(TERM, #{_pid}) : #{e}"
|
309
319
|
end
|
310
320
|
end
|
@@ -326,6 +336,7 @@ class TyrantManager
|
|
326
336
|
logger.info "Process #{_pid} is beyond my control"
|
327
337
|
rescue Errno::ESRCH
|
328
338
|
logger.info "Process #{_pid} is dead"
|
339
|
+
cleanup_pid_file
|
329
340
|
return false
|
330
341
|
rescue => e
|
331
342
|
logger.error "Problem sending kill(0, #{_pid}) : #{e}"
|
@@ -380,6 +391,20 @@ class TyrantManager
|
|
380
391
|
|
381
392
|
private
|
382
393
|
|
394
|
+
def cleanup_pid_file
|
395
|
+
if File.exist?( self.pid_file ) then
|
396
|
+
logger.warn "Pid file #{self.pid_file} still exists."
|
397
|
+
logger.warn "The tyrant server may have exited with a failure."
|
398
|
+
logger.warn "Here are the last few lines of the log file (#{self.log_file}):"
|
399
|
+
lines = %x[ tail -10 #{self.log_file} ]
|
400
|
+
lines.split("\n").each do |l|
|
401
|
+
logger.warn " #{l.strip}"
|
402
|
+
end
|
403
|
+
logger.warn "Cleaning up stale pid file for #{self.pid}"
|
404
|
+
File.unlink( self.pid_file )
|
405
|
+
end
|
406
|
+
end
|
407
|
+
|
383
408
|
#
|
384
409
|
# take the given path, and if it is not an absolute path append it
|
385
410
|
# to the home directory of the instance.
|
data/tasks/distribution.rake
CHANGED
@@ -34,5 +34,12 @@ if pkg_config = Configuration.for_if_exist?("packaging") then
|
|
34
34
|
desc "reinstall gem"
|
35
35
|
task :reinstall => [:uninstall, :repackage, :install]
|
36
36
|
|
37
|
-
|
37
|
+
desc "distribute copiously"
|
38
|
+
task :copious => [:clean, :package ] do
|
39
|
+
Rake::SshFilePublisher.new('jeremy@copiousfreetime.org',
|
40
|
+
'/var/www/vhosts/www.copiousfreetime.org/htdocs/gems/gems',
|
41
|
+
'pkg', "#{TyrantManager::GEM_SPEC.full_name}.gem").upload
|
42
|
+
sh "ssh jeremy@copiousfreetime.org rake -f /var/www/vhosts/www.copiousfreetime.org/htdocs/gems/Rakefile"
|
43
|
+
end
|
44
|
+
end
|
38
45
|
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
|
2
|
+
require 'tasks/config'
|
3
|
+
gem 'gemcutter'
|
4
|
+
require 'rake/gemcutter_pushtask'
|
5
|
+
|
6
|
+
#-----------------------------------------------------------------------
|
7
|
+
# Gemcutter additions to the task library
|
8
|
+
#-----------------------------------------------------------------------
|
9
|
+
namespace :dist do
|
10
|
+
desc "Release files to gemcutter"
|
11
|
+
|
12
|
+
GemCutter::Rake::PushTask.new do |t|
|
13
|
+
t.gem_file = File.expand_path( File.join( "pkg", "#{TyrantManager::GEM_SPEC.full_name}.gem" ) )
|
14
|
+
end
|
15
|
+
|
16
|
+
task :push => :gem
|
17
|
+
|
18
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tyrantmanager
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeremy Hinegardner
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-10-04 00:00:00 -06:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -40,7 +40,7 @@ dependencies:
|
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
42
42
|
- !ruby/object:Gem::Version
|
43
|
-
version: 1.
|
43
|
+
version: 1.2.2
|
44
44
|
version:
|
45
45
|
- !ruby/object:Gem::Dependency
|
46
46
|
name: main
|
@@ -50,7 +50,7 @@ dependencies:
|
|
50
50
|
requirements:
|
51
51
|
- - ~>
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version: 2.
|
53
|
+
version: 2.9.3
|
54
54
|
version:
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: configuration
|
@@ -58,9 +58,9 @@ dependencies:
|
|
58
58
|
version_requirement:
|
59
59
|
version_requirements: !ruby/object:Gem::Requirement
|
60
60
|
requirements:
|
61
|
-
- -
|
61
|
+
- - ~>
|
62
62
|
- !ruby/object:Gem::Version
|
63
|
-
version:
|
63
|
+
version: 1.1.0
|
64
64
|
version:
|
65
65
|
- !ruby/object:Gem::Dependency
|
66
66
|
name: rake
|
@@ -72,6 +72,16 @@ dependencies:
|
|
72
72
|
- !ruby/object:Gem::Version
|
73
73
|
version: 0.8.3
|
74
74
|
version:
|
75
|
+
- !ruby/object:Gem::Dependency
|
76
|
+
name: gemcutter
|
77
|
+
type: :development
|
78
|
+
version_requirement:
|
79
|
+
version_requirements: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
81
|
+
- - ~>
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: 0.1.4
|
84
|
+
version:
|
75
85
|
description: |-
|
76
86
|
A command line tool for managing Tokyo Tyrant instances. It allows for the
|
77
87
|
creation, starting, stopping, listing, stating of many tokyo tyrant instances
|
@@ -134,13 +144,14 @@ files:
|
|
134
144
|
- tasks/announce.rake
|
135
145
|
- tasks/distribution.rake
|
136
146
|
- tasks/documentation.rake
|
147
|
+
- tasks/gemcutter.rake
|
137
148
|
- tasks/rspec.rake
|
138
149
|
- tasks/rubyforge.rake
|
139
150
|
- tasks/config.rb
|
140
151
|
- tasks/utils.rb
|
141
152
|
- gemspec.rb
|
142
153
|
has_rdoc: true
|
143
|
-
homepage: http://
|
154
|
+
homepage: http://copiousfreetime.rubyforge.org/tyrantmanager
|
144
155
|
licenses: []
|
145
156
|
|
146
157
|
post_install_message:
|
@@ -164,7 +175,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
164
175
|
requirements: []
|
165
176
|
|
166
177
|
rubyforge_project: copiousfreetime
|
167
|
-
rubygems_version: 1.3.
|
178
|
+
rubygems_version: 1.3.5
|
168
179
|
signing_key:
|
169
180
|
specification_version: 3
|
170
181
|
summary: A command line tool for managing Tokyo Tyrant instances
|