lobster 0.1.1 → 0.1.2
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/lib/lobster/job.rb +11 -7
- data/lib/lobster/version.rb +1 -1
- metadata +4 -5
- data/LICENSE +0 -13
data/lib/lobster/job.rb
CHANGED
@@ -39,7 +39,7 @@ module Lobster
|
|
39
39
|
|
40
40
|
def run(out,err,dir)
|
41
41
|
Lobster.logger.info "Starting job #{@name}"
|
42
|
-
command_line = @user ? "sudo -
|
42
|
+
command_line = @user ? "sudo -inu #{@user} \"cd $PWD ; #{@command}\"" : @command
|
43
43
|
|
44
44
|
begin
|
45
45
|
@pid = spawn(command_line, :out=>out, :err=>err, :chdir=>dir)
|
@@ -70,12 +70,16 @@ module Lobster
|
|
70
70
|
end
|
71
71
|
|
72
72
|
Lobster.logger.info "Killing pid #{pid}"
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
73
|
+
if @user
|
74
|
+
`sudo -inu #{@user} "kill -s #{sig} #{pid}"`
|
75
|
+
else
|
76
|
+
begin
|
77
|
+
Process.kill sig, pid
|
78
|
+
rescue Errno::ESRCH
|
79
|
+
# Process already got killed somehow
|
80
|
+
rescue Exception => e
|
81
|
+
Lobster.logger.warn "Process #{pid} exception: #{e}"
|
82
|
+
end
|
79
83
|
end
|
80
84
|
end
|
81
85
|
end
|
data/lib/lobster/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lobster
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-01-
|
12
|
+
date: 2012-01-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: daemons
|
16
|
-
requirement: &
|
16
|
+
requirement: &75477200 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,7 +21,7 @@ dependencies:
|
|
21
21
|
version: 1.1.4
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *75477200
|
25
25
|
description: ''
|
26
26
|
email:
|
27
27
|
- m.brugidou@criteo.com
|
@@ -34,7 +34,6 @@ files:
|
|
34
34
|
- .gitignore
|
35
35
|
- Gemfile
|
36
36
|
- Gemfile.lock
|
37
|
-
- LICENSE
|
38
37
|
- README.md
|
39
38
|
- bin/lobster
|
40
39
|
- bin/lobsterize
|
data/LICENSE
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
Copyright 2011 Criteo
|
2
|
-
|
3
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
-
you may not use this file except in compliance with the License.
|
5
|
-
You may obtain a copy of the License at
|
6
|
-
|
7
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
8
|
-
|
9
|
-
Unless required by applicable law or agreed to in writing, software
|
10
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
-
See the License for the specific language governing permissions and
|
13
|
-
limitations under the License.
|