daemonz 0.3.7 → 0.3.8

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/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.7
1
+ 0.3.8
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "daemonz"
8
- s.version = "0.3.7"
8
+ s.version = "0.3.8"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Victor Costan"]
@@ -31,6 +31,7 @@ Gem::Specification.new do |s|
31
31
  "lib/daemonz/config.rb",
32
32
  "lib/daemonz/generators/config/config_generator.rb",
33
33
  "lib/daemonz/generators/config/templates/config.yml",
34
+ "lib/daemonz/generators/config/templates/prepackaged/delayed_job.yml",
34
35
  "lib/daemonz/generators/config/templates/prepackaged/ferret.yml",
35
36
  "lib/daemonz/generators/config/templates/prepackaged/starling.yml",
36
37
  "lib/daemonz/generators/daemon/daemon_generator.rb",
@@ -12,6 +12,7 @@ class ConfigGenerator < Rails::Generators::Base
12
12
  copy_file 'config.yml', 'config/daemonz.yml'
13
13
 
14
14
  empty_directory 'config/daemonz'
15
+ copy_file 'prepackaged/delayed_job.yml', 'config/daemonz/delayed_job.yml'
15
16
  copy_file 'prepackaged/ferret.yml', 'config/daemonz/ferret.yml'
16
17
  copy_file 'prepackaged/starling.yml', 'config/daemonz/starling.yml'
17
18
  end
@@ -0,0 +1,45 @@
1
+ # Daemonz example: configuration for running starling.
2
+ #
3
+ # daemonz starts the daemons according to the alphabetic order of their
4
+ # configuration file names. start_order can be used to override this order.
5
+ # Daemons will be stopped in the reverse order of their starting order.
6
+ #
7
+ # daemonz likes to ensure that multiple instances of a daemon don't run at the
8
+ # same time, as this can be fatal for daemons with on-disk state, like ferret.
9
+ # So daemonz ensures that a daemon is dead before starting it, and right after
10
+ # stopping it. This is achieved using the following means:
11
+ # * Stop commands: first, daemonz uses the stop command supplied in the
12
+ # daemon configuration
13
+ # * PID files: if the daemon has .pid files, daemonz tries to read the file
14
+ # and find the corresponding processes, then tree-kills them
15
+ # * Process table: if possible, daemonz dumps the process table, looks for
16
+ # the processes that look like the daemon, and tree-kills
17
+ # them
18
+ # * Pattern matching: processes whose command lines have the same arguments
19
+ # as those given to daemon "look like" that daemon
20
+ # * Tree killing: a daemon is killed by killing its main process, together
21
+ # with all processes descending from that process; a process
22
+ # is first sent SIGTERM and, if it's still alive after a
23
+ # couple of seconds, it's sent a SIGKILL
24
+
25
+ ---
26
+ delayed_job:
27
+ :binary: script/delayed_job
28
+ :absolute_binary: false
29
+ # The File.read expression computes the number of CPU cores in the system.
30
+ <% if Rails.env.production? and File.exist?('/proc/cpuinfo') %>
31
+ :start_args: --prefix <%= Rails.root %> -n <%= File.read("/proc/cpuinfo").scan(/^processor\s*:/).length - 1 %> start
32
+ <% else %>
33
+ :start_args: --prefix <%= Rails.root %> -n 1 start
34
+ <% end %>
35
+ :stop_args: stop
36
+ # Pattern for the PID file(s) used by the daemon.
37
+ :pids: tmp/pids/delayed_job.*.pid
38
+ # Override for the patterns used to identify the daemon's processes.
39
+ :kill_patterns:
40
+ - <%= Rails.root.join 'delayed_job' %>
41
+ # Time to wait after sending the stop command, before killing the daemon.
42
+ :delay_before_kill: 0.2
43
+ # daemonz will ignore this daemon configuration when this flag is true
44
+ :disabled: true
45
+
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: daemonz
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.7
4
+ version: 0.3.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -209,6 +209,7 @@ files:
209
209
  - lib/daemonz/config.rb
210
210
  - lib/daemonz/generators/config/config_generator.rb
211
211
  - lib/daemonz/generators/config/templates/config.yml
212
+ - lib/daemonz/generators/config/templates/prepackaged/delayed_job.yml
212
213
  - lib/daemonz/generators/config/templates/prepackaged/ferret.yml
213
214
  - lib/daemonz/generators/config/templates/prepackaged/starling.yml
214
215
  - lib/daemonz/generators/daemon/daemon_generator.rb
@@ -238,7 +239,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
238
239
  version: '0'
239
240
  segments:
240
241
  - 0
241
- hash: 4130437893997824476
242
+ hash: 714603519504973257
242
243
  required_rubygems_version: !ruby/object:Gem::Requirement
243
244
  none: false
244
245
  requirements: