Fix RHEL5 service stopping.

On RHEL5 a service stop returns a 1 instead of 0 if the thing is already
stopped, so we now check the status first before attempting to stop.
This commit is contained in:
Ashley Penney 2014-05-10 16:57:29 +02:00
parent 0be58d7a2c
commit a8705e2cb2

View file

@ -54,6 +54,7 @@ define postgresql::server::config_entry (
# service appropriately.
exec { 'postgresql_stop':
command => "service ${::postgresql::server::service_name} stop",
onlyif => "service ${::postgresql::server::service_name} status",
unless => "grep 'PGPORT=${value}' /etc/sysconfig/pgsql/postgresql",
path => '/sbin:/bin:/usr/bin:/usr/local/bin',
require => File['/etc/sysconfig/pgsql/postgresql'],