eclipsed 0.6.5 → 0.6.7

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f0e2de1b08b37b7cda7934843e08a214c35062fd
4
- data.tar.gz: fa7ebc1a0b3cc1c84f25cb6a7795146d72ef90fc
3
+ metadata.gz: aef37eaa61282506a7f41dd91f2b48cc333a14fb
4
+ data.tar.gz: 5330178fa707bcf21006c3a823aef263f36a061d
5
5
  SHA512:
6
- metadata.gz: 7a5b958d66deedfac3c92ed21c45eb2b5feceaec58741327cafb2d8a2ecfade48e063956b6ab22a2c37c8570bb641619e7da510a493e8182cee1281deaab73ba
7
- data.tar.gz: 05a6296110262c23bc41d10c6e1e2935567d262ff0f13fd1a062c9b5b3109a806c45e7fae41ce6abcd7299fc1f5507ad26cff2d5983b57d7acbcf4cfce57171b
6
+ metadata.gz: fc55d145a8cbd1148a229200e40ef931b511569fdf89e4b7ae7a63b5a06354d48a60f23a96e33ef2d3368cb7d81addb98bb202a4dc07406c1f7be2c7a0323783
7
+ data.tar.gz: 8a30210dc12e38cd4cfcc5a705c5d8b3f6690dd2c9a065fbd9d6236bdf849486a7d10b2cbff9f08b4338d992a0b6c914041037c1adbe4e78cddc180c4715be1a
data/lib/eclipsed.rb CHANGED
@@ -51,7 +51,7 @@ module Eclipsed
51
51
  @nodelist.each do |node|
52
52
  cmd = "ssh #{node} 'export PATH=\"#{ENV['PATH']}\"; export LD_LIBRARY_PATH=\"#{ENV['LD_LIBRARY_PATH']}\"; ulimit -Sn 4000; nohup eclipse_node </dev/null &>/dev/null &'"
53
53
  puts cmd if @verbose
54
- system cmd
54
+ system cmd unless @dryrun
55
55
  end
56
56
  thr.exit
57
57
  print "\r"
@@ -66,7 +66,7 @@ module Eclipsed
66
66
  if i != index.to_i then
67
67
  cmd = "ssh #{node} 'export PATH=\"#{ENV['PATH']}\"; nohup eclipse_node </dev/null &>/dev/null &'"
68
68
  puts cmd if @verbose
69
- system cmd
69
+ system cmd unless @dryrun
70
70
  end
71
71
  i = i + 1
72
72
  end
@@ -94,15 +94,15 @@ module Eclipsed
94
94
  i = i + 1
95
95
  end
96
96
  cmd = "ssh #{@nodelist[index.to_i]} -t \'export PATH=\"#{ENV['PATH']}\"; gdb --args eclipse_node \'"
97
- puts cmd
98
- exec cmd
97
+ puts cmd if @verbose
98
+ exec cmd unless @dryrun
99
99
  end
100
100
  #}}}
101
101
  # attach_at {{{
102
102
  def attach_at(index)
103
103
  cmd = "ssh #{@nodelist[index.to_i]} -t \"#{"sudo" if @sudo} gdb --pid \\`pgrep -u #{`whoami`.chomp} -x eclipse_node\\`\""
104
- puts cmd
105
- exec cmd
104
+ puts cmd if @verbose
105
+ exec cmd unless @dryrun
106
106
  end
107
107
  #}}}
108
108
  # show {{{
@@ -137,9 +137,9 @@ module Eclipsed
137
137
  thr = print_async "Stopping framework..."
138
138
  user = `whoami`.chomp
139
139
  @nodelist.each do |node|
140
- cmd = "ssh #{node} 'kill -s SIGKILL $(ps -o pgrp= -p $(pgrep -u vicente eclipse_node) | xargs echo - | tr -d [:blank:])'"
140
+ cmd = "ssh #{node} 'pgrep -u #{user} eclipse_node &>/dev/null && kill -s SIGKILL $(ps -o pgrp= -p $(pgrep -u #{user} -x eclipse_node) | xargs echo - | tr -d [:blank:])'"
141
141
  puts cmd if @verbose
142
- system cmd
142
+ system cmd unless @dryrun
143
143
  end
144
144
  thr.exit
145
145
  print "\r"
@@ -149,7 +149,7 @@ module Eclipsed
149
149
  @nodelist.each do |node|
150
150
  cmd = "ssh #{node} \'pkill -u #{`whoami`.chomp} #{input.join}\'"
151
151
  puts cmd if @verbose
152
- system cmd
152
+ system cmd unless @dryrun
153
153
  end
154
154
  end #}}}
155
155
  # pry {{{
@@ -171,7 +171,7 @@ module Eclipsed
171
171
  file_name = File.basename(input,File.extname(input))
172
172
  cmd = "g++ -std=c++14 -Wall -Werror -o #{file_name} #{file_name}.cc #{@lpath} -lvmr -lvdfs -lboost_system"
173
173
  puts cmd if @verbose
174
- system cmd
174
+ system cmd unless @dryrun
175
175
  end #}}}
176
176
  end
177
177
 
@@ -180,7 +180,7 @@ module Eclipsed
180
180
  super()
181
181
  configure()
182
182
 
183
- OptionParser.new do |opts|
183
+ opt = OptionParser.new do |opts|
184
184
  opts.banner = "eclipsed (Eclipse Daemon controler) is an script to manage the EclipseDFS\n" +
185
185
  "Usage: eclipsed [options] <actions> [FILE]..."
186
186
  opts.version = Eclipsed::VERSION
@@ -204,9 +204,17 @@ module Eclipsed
204
204
  opts.separator "Options"
205
205
  opts.on_tail("-h", "--help" , "recursive this") { puts opts; exit}
206
206
  opts.on_tail("-v", "--verbose" , "printout verbose info") { @verbose = true }
207
+ opts.on_tail("-n", "--dry-run" , "Show what its about to do") { @dryrun = true }
207
208
  opts.on_tail("-V", "--version" , "printout version") { puts opts.ver; exit }
208
209
  opts.on_tail("-s", "--sudo" , "Use sudo for attach") { @sudo = true }
209
- end.parse! input
210
+ end
211
+ opt.parse! input
212
+
213
+ if input.empty?
214
+ puts opt.help
215
+ exit
216
+ end
217
+
210
218
 
211
219
  case input.shift
212
220
  when 'launch' then launch
@@ -1,3 +1,3 @@
1
1
  module Eclipsed
2
- VERSION = "0.6.5"
2
+ VERSION = "0.6.7"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eclipsed
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.5
4
+ version: 0.6.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vicente Adolfo Bolea Sanchez
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-09-21 00:00:00.000000000 Z
11
+ date: 2017-10-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler