lib/remote_syslog/cli.rb in remote_syslog-1.6.7.pre1 vs lib/remote_syslog/cli.rb in remote_syslog-1.6.7
- old
+ new
@@ -176,10 +176,21 @@
else
@agent.pid_file = File.expand_path("#{@pid_directory}/remote_syslog.pid")
end
end
+ # We're dealing with an old-style pid_file
+ if @agent.pid_file && File.basename(@agent.pid_file) == @agent.pid_file
+ default_pid_dir = File.dirname(default_pid_file)
+
+ @agent.pid_file = File.join(default_pid_dir, @agent.pid_file)
+
+ if File.extname(@agent.pid_file) == ''
+ @agent.pid_file << '.pid'
+ end
+ end
+
@agent.pid_file ||= default_pid_file
if !@no_detach && !::Servolux.fork?
@no_detach = true
@@ -214,17 +225,9 @@
@agent.parse_fields = FIELD_REGEXES[config['parse_fields']] || Regexp.new(config['parse_fields'])
end
if config['exclude_patterns']
@agent.exclude_pattern = Regexp.new(config['exclude_patterns'].map { |r| "(#{r})" }.join('|'))
- end
-
- if config['exclude_files']
- @agent.exclude_file_pattern = Regexp.new(config['exclude_files'].map { |r| "(#{r})" }.join('|'))
- end
-
- if config['new_file_check_interval']
- @agent.glob_check_interval = config['new_file_check_interval']
end
end
def run
Thread.abort_on_exception = true