cloudblocks 0.0.12h → 0.0.12i
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/bin/cb-agent +12 -6
- metadata +1 -1
data/bin/cb-agent
CHANGED
@@ -34,14 +34,14 @@ public
|
|
34
34
|
|
35
35
|
def start
|
36
36
|
begin
|
37
|
-
@log.info "
|
38
|
-
puts "
|
37
|
+
@log.info "Attempting to start the CloudBlocks Agent"
|
38
|
+
puts "Attempting to start the CloudBlocks Agent"
|
39
39
|
|
40
40
|
pid = get_pid
|
41
41
|
if pid != 0
|
42
42
|
#check if the process is actually running
|
43
43
|
if pid_process_running?(pid)
|
44
|
-
warn "The CloudBlocks Agent
|
44
|
+
warn "The CloudBlocks Agent was already running. Use stop command to stop it or --help for more info"
|
45
45
|
exit -1
|
46
46
|
else
|
47
47
|
File.delete(@pid_full)
|
@@ -71,16 +71,21 @@ def start
|
|
71
71
|
Process.kill('TERM', pid)
|
72
72
|
warn "Cannot start the CloudBlocks Agent: #{exc.message}"
|
73
73
|
end
|
74
|
+
|
75
|
+
puts "The CloudBlocks Agent has been started"
|
74
76
|
else
|
75
77
|
run
|
76
78
|
end
|
77
79
|
|
80
|
+
|
78
81
|
exit 0
|
79
82
|
end
|
80
83
|
|
81
84
|
def stop
|
82
85
|
pid = get_pid
|
83
|
-
@log.info "
|
86
|
+
@log.info "Trying to stop the CloudBlocks Agent"
|
87
|
+
puts "Trying to stop the CloudBlocks Agent"
|
88
|
+
|
84
89
|
begin
|
85
90
|
@quartz.status(2, @version, plugin_meta_data)
|
86
91
|
EM.stop
|
@@ -93,9 +98,9 @@ def stop
|
|
93
98
|
rescue
|
94
99
|
end
|
95
100
|
File.delete(@pid_full)
|
96
|
-
puts "The CloudBlocks Agent
|
101
|
+
puts "The CloudBlocks Agent has been stopped"
|
97
102
|
else
|
98
|
-
warn "
|
103
|
+
warn "Nothing to do - the CloudBlocks Agent was not running"
|
99
104
|
exit -1
|
100
105
|
end
|
101
106
|
end
|
@@ -122,6 +127,7 @@ def unregister
|
|
122
127
|
@agent_id = ""
|
123
128
|
@quartz.unregister(@agent_id)
|
124
129
|
save_config
|
130
|
+
puts "Unregistered"
|
125
131
|
end
|
126
132
|
|
127
133
|
private
|