omf_rc_shm 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MGJmYzJiN2IzNjQ4YzFjMzdjNDNiYzM3YWE2NWI0YmFiMmIxY2Q1NA==
4
+ MzM2N2U2OTlhYmM5Y2MwNzYzYTNjYTJjNTY5YTNiYzZjZjdhMzYzZQ==
5
5
  data.tar.gz: !binary |-
6
- ZTM3ZTI1ZTZlMjIyODg0ZmE2MTg0ZGRjZjExZjBjMGU3ZDEzNTQwYg==
6
+ ODFlNDQyMGMxOGM4MzU4NDYyYTMzZjA3NDA0MjRjM2Q4MjYxZDMwNw==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- MTYwZTJkYzRmYTI0NmQ1MzEyYjA4YTMyMGVmZjA2YzNmMWU2OTJjMmI1Mjdl
10
- ODA3YjBmMTQwYzAyZWE5ZmFhYzI2YmNmMzgzZjIwM2E5ZGFjNGMxMzdlYjJi
11
- MjA2ZGIzYjA2ZWUzOGM0ODg1YjI0NTRkYjM5NTJiNThiMWFmOTI=
9
+ ZTc5ZDIyNjA4NjMzYWJlMjJjZjExMDViZGY3YzhlNzM0OTVhZDk1OTc4MDQy
10
+ ZGZkMTcyMGRlNzM4ODY0ZjczNzU4MjAxMGU0ZWZlYzM0Y2FhYzNiYWM0ZTg5
11
+ Mjg5NTU3ZGQ5OWZmZTMwMjI0ZDM5ODNlYzlhMTE3ZmYwNDM1ZjE=
12
12
  data.tar.gz: !binary |-
13
- MThkNzZmMGY5MDIwY2M1NjQwNzAxY2RmMDdiMzViYmIzYzZjZGVmNDg4ODRl
14
- MDY3OGRkYzQ3ZDkxYWU0NjFmMzgxMTI1OWY0ZWE3YmJhNDJiMTIxNWY1NjM0
15
- YzA5YzQ4MmY5NDgwZTc1NDk0ZmFmOTE2YmY5MjRmYmQ2MzU4Nzk=
13
+ MjVmZGUxZjk1NDNiYjIyNTgzYzdlOGIyOGM3YjcxZDEwNzY5MTI4ZDkyMzVh
14
+ YjkzMWUwODc5Yzg1OGJmOTg4MWY5OGYxZGFiNWYwNDczMzA2NmFiZGY5NGJl
15
+ ZTM1OTVkNzMxNjk0MTI0M2Y1ZDA4OGY5M2I3ZDk4ZTk1ZWFiMjE=
@@ -13,7 +13,10 @@ if timeout && timeout.to_i > 0
13
13
  end
14
14
  end
15
15
 
16
- Process.waitpid(pid)
17
-
18
- `echo Process #{pid} exited with code: #{$?.exitstatus} >> #{stderr_f}`
16
+ p_id, p_status = Process.waitpid2(pid)
19
17
 
18
+ if p_status.exitstatus
19
+ `echo Process #{p_id} #{cmd} exited with status: #{p_status.exitstatus} >> #{stderr_f}`
20
+ elsif p_status.signaled?
21
+ `echo Process #{p_id} #{cmd} killed by signal: #{p_status.termsig} >> #{stderr_f}`
22
+ end
data/config/rc.yml.sample CHANGED
@@ -7,10 +7,11 @@
7
7
  :resources:
8
8
  - :type: shm_node
9
9
  :uid: <%= Socket.gethostname %>
10
- :app_definition_file: path_to_your_app_definition_file
10
+ :app_definition_file: path_to_your_app_definition_file
11
+ :ruby_path: <full_path_to_ruby>
11
12
 
12
- :add_default_factories: false # Not loading default type factories
13
+ :add_default_factories: false # Not loading default type factories
13
14
 
14
- :factories: # Additional resources which can be created by this RC
15
- - :require: omf_rc_shm
15
+ :factories: # Additional resources which can be created by this RC
16
+ - :require: omf_rc_shm
16
17
 
@@ -328,6 +328,7 @@ module OmfRc::ResourceProxy::ScheduledApplication
328
328
  app_wrapper_path = File.expand_path("#{File.dirname(__FILE__)}/../../../bin/cronjob_app_wrapper")
329
329
 
330
330
  cmd = "#{app_wrapper_path} #{stdout_file} #{stderr_file} #{pid_file} #{res.property.timeout} #{res.property.timeout_kill_signal} #{res.build_command_line}"
331
+ cmd = "#{res.property.ruby_path} #{cmd}" if res.property.ruby_path
331
332
 
332
333
  info "Adding cron job for '#{res.property.app_id}' with schedule '#{res.property.schedule}' and command '#{cmd}'"
333
334
 
@@ -5,6 +5,7 @@ module OmfRc::ResourceProxy::ShmNode
5
5
 
6
6
  property :app_definition_file
7
7
  property :oml_uri
8
+ property :ruby_path
8
9
 
9
10
  request :cron_jobs do |node|
10
11
  node.children.find_all { |v| v.type =~ /scheduled_application/ }.map do |v|
@@ -1,3 +1,3 @@
1
1
  module OmfRcShm
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omf_rc_shm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - NICTA