Skip to content

PID dir can be specified for worker processes #174

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions bin/god
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ begin
options[:port] = x
end


opts.on("-b", "--auto-bind", "Auto-bind to an unused port number") do
options[:port] = "0"
end
Expand All @@ -60,6 +61,10 @@ begin
options[:pid] = x
end

opts.on("-MDIR", "--managed_pid_dir DIR", "Where to write the PIDs for the workers") do |x|
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this setting would be fine without a short option. Could you remove the -M option?

Also, the command line options use - between words instead of _.

options[:managed_pid_dir] = x
end

opts.on("-lFILE", "--log FILE", "Where to write the log file") do |x|
options[:log] = x
end
Expand Down
2 changes: 1 addition & 1 deletion god.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Gem::Specification.new do |s|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=

s.name = 'god'
s.version = '0.13.4'
s.version = '0.13.4.1'
s.date = '2014-03-05'

s.summary = "Process monitoring framework."
Expand Down
2 changes: 1 addition & 1 deletion lib/god.rb
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ def safe_attr_accessor(*args)

module God
# The String version number for this package.
VERSION = '0.13.4'
VERSION = '0.13.4.1'

# The Integer number of lines of backlog to keep for the logger.
LOG_BUFFER_SIZE_DEFAULT = 100
Expand Down
4 changes: 4 additions & 0 deletions lib/god/cli/run.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ def default_run
God.port = @options[:port]
end

if @options[:managed_pid_dir]
God.pid_file_directory = @options[:managed_pid_dir]
end

if @options[:events]
God::EventHandler.load
end
Expand Down