FIX #823 wrong postgres path detection

Signed-off-by: Patrick Münch <patrick.muench1111@gmail.com>
This commit is contained in:
Patrick Münch 2016-07-12 19:59:08 +02:00
parent c94751fcf9
commit 7d986c2d17

View file

@ -24,6 +24,13 @@ module Inspec::Resources
@conf_dir = '/var/lib/postgres/data' @conf_dir = '/var/lib/postgres/data'
@conf_path = File.join @conf_dir, 'postgresql.conf' @conf_path = File.join @conf_dir, 'postgresql.conf'
when 'centos', 'redhat'
@service = 'postgresql'
@version = inspec.command('ls /var/lib/pgsql/').stdout.chomp
@data_dir = "/var/lib/pgsql/#{@version}/data"
@conf_dir = "/var/lib/pgsql/#{@version}/data"
@conf_path = File.join @conf_dir, 'postgresql.conf'
else else
@service = 'postgresql' @service = 'postgresql'
@data_dir = '/var/lib/postgresql' @data_dir = '/var/lib/postgresql'