From 2addfac215319267b63e2333e5cf909b0be34c27 Mon Sep 17 00:00:00 2001 From: Ossi Salmi Date: Wed, 16 Feb 2011 11:25:40 +0200 Subject: [PATCH] Fixed puppet-check for Puppet 2.6 --- puppet/files/puppet-check | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/puppet/files/puppet-check b/puppet/files/puppet-check index 2fe60ca..fe1db2b 100755 --- a/puppet/files/puppet-check +++ b/puppet/files/puppet-check @@ -5,8 +5,16 @@ require "socket" Puppet.parse_config +if Puppet.version[/\d+/].to_i >= 2 + puppetd = "puppet agent" + pidname = "agent.pid" +else + puppetd = "puppetd" + pidname = "puppetd.pid" +end + # get pid number for puppet or exit if not found -pidfile = Puppet.settings.value("rundir") + "/puppetd.pid" +pidfile = File.join(Puppet.settings.value("rundir"), pidname) begin pid = File.new(pidfile, "r").read.to_i rescue Errno::ENOENT @@ -27,5 +35,5 @@ printf("puppetd dead but pid file exists on host '%s', restarting\n", begin exec("service puppet start") rescue Errno::ENOENT - exec("puppetd") + exec(puppetd) end