omf_rc_shm 0.1.6 → 0.1.7

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
- Y2U5ZGUyMzMyNGQzZThkZjk4OWZjMzIwOTNlMWQxYThhZDkwZDg1Zg==
4
+ ODIxMDgzNTk2ZmViYzBlNDViZDVhNTBlZTIwN2NlODQ2ZWI0ZWRmMw==
5
5
  data.tar.gz: !binary |-
6
- MzYyNGVhZTg5NWQ4ODdiNTY2ZjhlNmZmZGFjNjkzMzE1YTFjNWRlMg==
6
+ MmJiMDE0Yzk0MTA0Mzc1ZjM2NzhhMzM2YjJhZGI2NjI5ZjMxYTM5Yg==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- NGNhZTUzNzY1OWMyZTBmMzA2ZTk1ZjcyMzVhMTU0MGUwZGM0NWI1ZGM4YjVi
10
- ZjU5MTQ4ZjRkYmUyYmVlOGNkZGY1MmYwMGJiZjgzZWRlOTgyZmQ0ODY4Zjhh
11
- MjBhYzAwOWViZmI0ZDFkYjRmMTJiMGMyNTI4YjVlMTA4MjU1YjQ=
9
+ M2ZmNzI5MjNjZDM3MDI2NjhhNWNjMjE0ZmI3OTBhODU2NDJmNDFjNDcwOTZi
10
+ YTQxOWM4MDMxNzQ4Mjk1NjA5ZTgxYzQwNzIwNGY4YjVhOWFmMWM0ODIxNGQz
11
+ ZDVlZDAwYTc4N2RlMmFhYWJjMWI0NjlkM2YxNTQ1OWVlODMyZmE=
12
12
  data.tar.gz: !binary |-
13
- NjlmZWE0YmNlMTE3NTlmN2MzZmMxZTQxZDBhMjI5NmYwMTcyMzZkODcyNmFl
14
- NTNkYTJkOWUwY2MzYjNiYjgxNjEwMDdjMDZhNWEwNzM5NzQ4NmIyZTBmNjA0
15
- YTg5NDQwZTQ3Zjg4MzcwZWUyZWIyNTE2OGEyYzVkYzljNzNhNTg=
13
+ YmIzNmI4ZTc4ODMyMDEwNmI5YjJiMTA1ZWJjMGFhNzUwM2I2OTExNmY3MWQz
14
+ YzgxMWM3MDQyMDlkY2IxOThhYjMxZTQ1ZjhkYzUwYzlmMDllZWI2NGJhYjBh
15
+ M2Q5NWE0NmY3YWNhMWFiYjNiNTk1NTU2NDE5YzhlZDFmN2I2MWQ=
data/config/rc.yml.sample CHANGED
@@ -6,9 +6,12 @@
6
6
 
7
7
  :resources:
8
8
  - :type: shm_node
9
- :uid: <%= Socket.gethostname %>
9
+ :uid: <%= ip = `ifconfig br0`.match(/inet addr:(\d*\.\d*\.\d*\.\d*)/)[1].split('.') ; 'node' + (ip[2].to_i*256+ip[3].to_i).to_s.rjust(4,'0') %>
10
10
  :app_definition_file: path_to_your_app_definition_file
11
11
  :ruby_path: <full_path_to_ruby>
12
+ # Uncomment :watchdog_timer line to start the watchdog time, set the top-up
13
+ # value in second (make sure to have it lower than timeout value)
14
+ #:watchdog_timer: 15
12
15
 
13
16
  :add_default_factories: false # Not loading default type factories
14
17
 
@@ -6,6 +6,7 @@ module OmfRc::ResourceProxy::ShmNode
6
6
  property :app_definition_file
7
7
  property :oml_uri
8
8
  property :ruby_path
9
+ property :watchdog_timer, :default => nil
9
10
 
10
11
  request :cron_jobs do |node|
11
12
  node.children.find_all { |v| v.type =~ /scheduled_application/ }.map do |v|
@@ -24,6 +25,13 @@ module OmfRc::ResourceProxy::ShmNode
24
25
  s_app.configure_state(:scheduled)
25
26
  end
26
27
  end
28
+ # if required, start the watchdog timer and periodically top it
29
+ unless node.property.watchdog_timer.nil?
30
+ info "Watchdog Timer started with interval: #{node.property.watchdog_timer}"
31
+ EventMachine.add_periodic_timer(node.property.watchdog_timer.to_i) do
32
+ `echo "1" >/dev/watchdog`
33
+ end
34
+ end
27
35
  end
28
36
 
29
37
  hook :before_ready do
@@ -1,3 +1,3 @@
1
1
  module OmfRcShm
2
- VERSION = "0.1.6"
2
+ VERSION = "0.1.7"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omf_rc_shm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - NICTA
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-09-10 00:00:00.000000000 Z
11
+ date: 2013-09-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler