Class: DRbQS::Manage
- Inherits:
-
Object
show all
- Extended by:
- Forwardable
- Defined in:
- lib/drbqs/manage/manage.rb,
lib/drbqs/manage/ssh_shell.rb,
lib/drbqs/manage/send_signal.rb,
lib/drbqs/manage/ssh_execute.rb
Defined Under Namespace
Classes: NoServerRespond, NotSetURI, SSHExecute, SSHShell, SendSignal
Constant Summary
collapse
- WAIT_SERVER_TIME =
0.2
- WAIT_MAX_NUMBER =
150
Instance Method Summary
collapse
Constructor Details
#initialize(opts = {}) ⇒ Manage
+opts+ has keys :home and :uri.
19
20
21
22
23
|
# File 'lib/drbqs/manage/manage.rb', line 19
def initialize(opts = {})
@opts = opts
@config = nil
@signal_sender = nil
end
|
Instance Method Details
#clear_process ⇒ Object
106
107
108
|
# File 'lib/drbqs/manage/manage.rb', line 106
def clear_process
config.list.clear_process_not_exist
end
|
#create_config ⇒ Object
56
57
58
|
# File 'lib/drbqs/manage/manage.rb', line 56
def create_config
config.save_sample
end
|
#list_process ⇒ Object
102
103
104
|
# File 'lib/drbqs/manage/manage.rb', line 102
def list_process
{ :server => config.list.server.list, :node => config.list.node.list }
end
|
#server_respond? ⇒ Boolean
65
66
67
68
69
70
71
72
73
74
75
76
|
# File 'lib/drbqs/manage/manage.rb', line 65
def server_respond?
ret = nil
begin
if get_response
ret = true
end
rescue DRbQS::Manage::NotSetURI
raise
rescue
end
ret
end
|
#set_home_directory(dir) ⇒ Object
29
30
31
|
# File 'lib/drbqs/manage/manage.rb', line 29
def set_home_directory(dir)
@opts[:home] = dir
end
|
#set_uri(uri) ⇒ Object
25
26
27
|
# File 'lib/drbqs/manage/manage.rb', line 25
def set_uri(uri)
@opts[:uri] = uri
end
|
#wait_server_process(pid = nil) ⇒ Object
If the server responds, this method returns true.
If the server process does not exist, this method return nil.
If the server process exists and there is no response,
this method raises error.