foreman_debian 0.0.10 → 0.0.11

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: 81ff7b62053b9605997acba74dc6005957fcf7cd
4
- data.tar.gz: a90106da6bbb7bb20c7f1cbbb0ff956681fcc995
3
+ metadata.gz: d36c851de35ae04015e73084baa78e2db1fe9656
4
+ data.tar.gz: e49cab29d9fc6700bf3c331a941a03bd99b3fd69
5
5
  SHA512:
6
- metadata.gz: 6311435424bb6c9ee691797db6791ecf46dd9e1569490a3987a5c85e2f50e355b7348c2cdd6b9cf29175bb0642b00d100d119f783bf5795cfb1e4fcb4a2c2301
7
- data.tar.gz: 2fbf8b7c5f779f19c9c6ce97d736837c7e0c8699354b9f6957a778c58e4a98375e72e0dcb650f4eede43c7c87f1510d1dd672cad64696fa09a4cdfef297499d3
6
+ metadata.gz: 31d5bdb8ee1d54c3f89e4f4479fe7cd2af8b4fc696c07bf7c0e09f9a9bce7ca248f1389edc90fdda1e12941d30cf2afa781d44913ad4f2d49aca4dfb798b5f93
7
+ data.tar.gz: 7c5eed98bcbffef0787d8cda426a55215f2dbca41f77686aefa32517d09ba9abb5b457c2750c9ac81b408aa46e636b5a4b78db1b3a9d987064203d7afd4c0a79
@@ -16,6 +16,10 @@ module ForemanDebian
16
16
  :attribute_name => :working_dir,
17
17
  :default => Dir.getwd
18
18
 
19
+ option %w(-R --retry), '<timeout|schedule>', 'Timeout or schedule when stopping (see man start-stop-daemon)',
20
+ :attribute_name => :timeout_schedule,
21
+ :default => '20'
22
+
19
23
  def execute
20
24
  jobs = {}
21
25
  procfile.entries do |name, command|
@@ -11,13 +11,13 @@ module ForemanDebian
11
11
  setup
12
12
  end
13
13
 
14
- def create_script(name, command, user)
14
+ def create_script(name, command, user, timeout_schedule = '20')
15
15
  pidfile = pidfile(name)
16
16
  args = Shellwords.split(command)
17
17
  script = args.shift
18
18
  name = "#{@app}-#{name}"
19
19
  script_path = @export_path.join(name)
20
- Script.new(script_path, name, name, user, script, args, pidfile)
20
+ Script.new(script_path, name, name, user, script, args, pidfile, timeout_schedule)
21
21
  end
22
22
 
23
23
  def install(script)
@@ -2,9 +2,9 @@ module ForemanDebian
2
2
  module Initd
3
3
  class Script < Template::Storage
4
4
 
5
- attr_reader :path, :name, :description, :user, :script, :arguments, :pidfile
5
+ attr_reader :path, :name, :description, :user, :script, :arguments, :pidfile, :timeout_schedule
6
6
 
7
- def initialize(path, name, description, user, script, arguments, pidfile)
7
+ def initialize(path, name, description, user, script, arguments, pidfile, timeout_schedule)
8
8
  @path = path
9
9
  @name = name
10
10
  @description = description
@@ -12,6 +12,7 @@ module ForemanDebian
12
12
  @script = script
13
13
  @arguments = arguments
14
14
  @pidfile = pidfile
15
+ @timeout_schedule = timeout_schedule
15
16
  end
16
17
 
17
18
  def render
@@ -36,7 +36,7 @@ case "${1}" in
36
36
  ;;
37
37
  stop)
38
38
  log_daemon_msg "Stopping ${DESC}" "${NAME}"
39
- if (start-stop-daemon --stop --oknodo --retry 20 --pidfile $PIDFILE --chuid $DAEMON_USER); then
39
+ if (start-stop-daemon --stop --oknodo --retry <%= Shellwords.escape timeout_schedule %> --pidfile $PIDFILE --chuid $DAEMON_USER); then
40
40
  log_end_msg 0
41
41
  else
42
42
  log_end_msg 1
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_debian
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10
4
+ version: 0.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - cargomedia
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-08-06 00:00:00.000000000 Z
12
+ date: 2014-09-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: clamp
@@ -125,7 +125,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
125
125
  version: '0'
126
126
  requirements: []
127
127
  rubyforge_project:
128
- rubygems_version: 2.2.2
128
+ rubygems_version: 2.4.1
129
129
  signing_key:
130
130
  specification_version: 4
131
131
  summary: Foreman wrapper for debian