Skip to content
This repository was archived by the owner on Dec 19, 2019. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion lib/haproxyctl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module HAProxyCTL

def start
puts 'starting haproxy...'
system("#{exec} -f #{config_path} -D -p #{pidfile}")
system("#{exec} -f #{config_path} #{conf_fol} -D -p #{pidfile}")
newpids = check_running
if newpids.all? {|newpid| newpid =~ /^\d+$/}
puts "haproxy is running on pid #{newpids.join(', ')}"
Expand Down
13 changes: 12 additions & 1 deletion lib/haproxyctl/environment.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module HAProxyCTL
module Environment
attr_accessor :pidof, :config_path, :config, :exec
attr_accessor :pidof, :config_path, :config, :exec, :conf_fol

def version
puts "HAProxyCTL #{HAProxyCTL::VERSION}"
Expand All @@ -18,6 +18,17 @@ def has_exec?
!exec.nil?
end

def conf_fol
@conf_fol ||= begin
@x = ""
Dir.foreach('/etc/haproxy/conf.d') do |i|
next if i == '.' or i == '..'
@x = "#{@x} -f /etc/haproxy/conf.d/#{i}"
end
(@x)
end
end

def exec
return(@exec) if @exec

Expand Down