thuehlinger / daemons

Ruby daemons gem official repository
MIT License
648 stars 71 forks source link

configurable pid-file delimiters - proposed solution for #40 #72

Closed tardate closed 5 years ago

tardate commented 5 years ago

Here's a possible solution re the discussion on #40 (and the related DJ issue https://github.com/collectiveidea/delayed_job/issues/798)..

Adds configurability of the pid file delimiter, so that daemons can continue with the default 1.2.3+ <name>_num<i>.pid format, while projects that use daemons can continue with their conventions.

Specifically, DelayedJob can continue to use <name>.<i>.pid format for backwards compatibility.

The only change on the DelayedJob side would be in https://github.com/collectiveidea/delayed_job/blob/master/lib/generators/delayed_job/templates/script e.g.:

#!/usr/bin/env ruby

require File.expand_path(File.join(File.dirname(__FILE__), '..', 'config', 'environment'))
require 'delayed/command'
Delayed::Command.new(ARGV + ['--daemon-options', '--pid_delimiter,.']).daemonize