diff --git a/Changelog.md b/Changelog.md index 9a94214e1..c1758e844 100644 --- a/Changelog.md +++ b/Changelog.md @@ -9,6 +9,7 @@ * Add new moderator role. Moderators can view and act on reported posts [#6351](https://github.com/diaspora/diaspora/pull/6351) * Only post to the primary tumblr blog [#6386](https://github.com/diaspora/diaspora/pull/6386) * Always show public photos on profile page [#6398](https://github.com/diaspora/diaspora/pull/6398) +* Expose Unicorn's pid option to our configuration system [#6411](https://github.com/diaspora/diaspora/pull/6411) # 0.5.3.1 diff --git a/config/defaults.yml b/config/defaults.yml index ef310f938..33e71fe46 100644 --- a/config/defaults.yml +++ b/config/defaults.yml @@ -42,6 +42,7 @@ defaults: port: listen: '0.0.0.0:3000' rails_environment: 'development' + pid: stderr_log: stdout_log: unicorn_worker: 2 diff --git a/config/diaspora.yml.example b/config/diaspora.yml.example index fadd51328..f6f26ae2b 100644 --- a/config/diaspora.yml.example +++ b/config/diaspora.yml.example @@ -171,6 +171,9 @@ configuration: ## Section ## Note: this setting is deprecated, use listen instead. #port: 3000 + ## Set the path for the PID file of the unicorn master process (default=none) + #pid: '/run/diaspora/diaspora.pid' + ## Rails environment (default='development'). ## The environment in which the server should be started by default. ## Change this to 'production' if you wish to run a production environment. diff --git a/config/unicorn.rb b/config/unicorn.rb index f70f54fa8..3877630cf 100644 --- a/config/unicorn.rb +++ b/config/unicorn.rb @@ -4,6 +4,7 @@ port = ENV["PORT"] port = port && !port.empty? ? port.to_i : nil listen port || AppConfig.server.listen.get unless RACKUP[:set_listener] +pid AppConfig.server.pid.get if AppConfig.server.pid? worker_processes AppConfig.server.unicorn_worker.to_i timeout AppConfig.server.unicorn_timeout.to_i stderr_path AppConfig.server.stderr_log.get if AppConfig.server.stderr_log?