Skip to content
This repository was archived by the owner on May 14, 2021. It is now read-only.

Commit c49e8e0

Browse files
committed
COOK-3367 Pass through more unicorn parameters
1 parent 5f7acac commit c49e8e0

2 files changed

Lines changed: 22 additions & 1 deletion

File tree

providers/unicorn.rb

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,22 @@
5656
new_resource = @new_resource
5757

5858
unicorn_config "/etc/unicorn/#{new_resource.name}.rb" do
59-
listen({ new_resource.port => new_resource.options })
59+
listen(new_resource.listen || { new_resource.port => new_resource.options })
6060
working_directory ::File.join(new_resource.path, 'current')
6161
worker_timeout new_resource.worker_timeout
6262
preload_app new_resource.preload_app
6363
worker_processes new_resource.worker_processes
6464
before_fork new_resource.before_fork
65+
after_fork new_resource.after_fork
66+
forked_user new_resource.forked_user
67+
forked_group new_resource.forked_group
68+
before_exec new_resource.before_exec
69+
pid new_resource.pid
70+
stderr_path new_resource.stderr_path
71+
stdout_path new_resource.stdout_path
72+
unicorn_command_line new_resource.unicorn_command_line
73+
copy_on_write new_resource.copy_on_write
74+
enable_stats new_resource.enable_stats
6575
end
6676

6777
runit_service new_resource.name do

resources/unicorn.rb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,21 @@
2323
attribute :preload_app, :kind_of => [TrueClass, FalseClass], :default => false
2424
attribute :worker_processes, :kind_of => Integer, :default => [node['cpu']['total'].to_i * 4, 8].min
2525
attribute :before_fork, :kind_of => String, :default => 'sleep 1'
26+
attribute :after_fork, :kind_of => [String, NilClass], :default => nil
2627
attribute :port, :kind_of => String, :default => "8080"
2728
attribute :worker_timeout, :kind_of => Integer, :default => 60
2829
attribute :bundler, :kind_of => [TrueClass, FalseClass, NilClass], :default => nil
2930
attribute :bundle_command, :kind_of => [String, NilClass], :default => nil
31+
attribute :listen, :kind_of => [Hash, NilClass], :default => nil
32+
attribute :forked_user, :kind_of => [String, NilClass], :default => nil
33+
attribute :forked_group, :kind_of => [String, NilClass], :default => nil
34+
attribute :before_exec, :kind_of => [String, NilClass], :default => nil
35+
attribute :pid, :kind_of => [String, NilClass], :default => nil
36+
attribute :stderr_path, :kind_of => [String, NilClass], :default => nil
37+
attribute :stdout_path, :kind_of => [String, NilClass], :default => nil
38+
attribute :unicorn_command_line, :kind_of => [String, NilClass], :default => nil
39+
attribute :copy_on_write, :kind_of => [TrueClass, FalseClass], :default => false
40+
attribute :enable_stats, :kind_of => [TrueClass, FalseClass], :default => false
3041

3142
def options(*args, &block)
3243
@options ||= Mash[:tcp_nodelay => true, :backlog => 100]

0 commit comments

Comments
 (0)