¹ http://groups.google.com/group/puppet-dev/browse_thread/thread/c3767380b2420bb7
Todd Zullinger (2):
conf/redhat/client.init: Fix #2123, status options on older RHEL
conf/redhat/*.init: Fix condrestart/try-restart
conf/redhat/client.init | 15 ++++++++++++---
conf/redhat/server.init | 11 ++++++++---
2 files changed, 20 insertions(+), 6 deletions(-)
Signed-off-by: Todd Zullinger <t...@pobox.com>
---
conf/redhat/client.init | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/conf/redhat/client.init b/conf/redhat/client.init
index 114fb18..bccb45c 100644
--- a/conf/redhat/client.init
+++ b/conf/redhat/client.init
@@ -62,6 +62,11 @@ restart() {
start
}
+rh_status() {
+ status | grep -q -- '-p' 2>/dev/null && statusopts="-p $pidfile"
+ status $statusopts $puppetd
+}
+
genconfig() {
echo -n $"Generate configuration puppet: "
$puppetd ${PUPPET_OPTS} ${PUPPET_EXTRA_OPTS} --genconfig
@@ -84,8 +89,7 @@ case "$1" in
[ -f "$pidfile" ] && restart
;;
status)
- status -p "$pidfile" $puppetd
- RETVAL=$?
+ rh_status
;;
once)
shift
--
1.6.4
This was reported by Ingvar Hagelund in Red Hat bug #480600.
Signed-off-by: Todd Zullinger <t...@pobox.com>
---
conf/redhat/client.init | 7 ++++++-
conf/redhat/server.init | 11 ++++++++---
2 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/conf/redhat/client.init b/conf/redhat/client.init
index bccb45c..401151c 100644
--- a/conf/redhat/client.init
+++ b/conf/redhat/client.init
@@ -67,6 +67,10 @@ rh_status() {
status $statusopts $puppetd
}
+rh_status_q() {
+ rh_status >/dev/null 2>&1
+}
+
genconfig() {
echo -n $"Generate configuration puppet: "
$puppetd ${PUPPET_OPTS} ${PUPPET_EXTRA_OPTS} --genconfig
@@ -86,7 +90,8 @@ case "$1" in
reload
;;
condrestart|try-restart)
- [ -f "$pidfile" ] && restart
+ rh_status_q || exit 0
+ restart
;;
status)
rh_status
diff --git a/conf/redhat/server.init b/conf/redhat/server.init
index 8f05387..4bc44b9 100644
--- a/conf/redhat/server.init
+++ b/conf/redhat/server.init
@@ -89,7 +89,7 @@ genconfig() {
$PUPPETMASTER $PUPPETMASTER_OPTS --genconfig
}
-puppetmaster_status() {
+rh_status() {
if [ -n "$PUPPETMASTER_PORTS" ] && [ ${#PUPPETMASTER_PORTS[@]} -gt 1 ]; then
for ((i=0; i<${#PUPPETMASTER_PORTS[@]}; i++)); do
echo -en "Port ${PUPPETMASTER_PORTS[$i]}: "
@@ -103,6 +103,10 @@ puppetmaster_status() {
return $RETVAL
}
+rh_status_q() {
+ rh_status >/dev/null 2>&1
+}
+
case "$1" in
start)
start
@@ -114,10 +118,11 @@ case "$1" in
restart
;;
condrestart)
- [ -f "$lockfile" ] && restart
+ rh_status_q || exit 0
+ restart
;;
status)
- puppetmaster_status
+ rh_status
;;
genconfig)
genconfig
--
1.6.4
I forgot to mention that these patches are available at
git://jet.mox.net/~tmz/puppet.git on the feature/master/initscripts
branch.
--
Todd OpenPGP -> KeyID: 0xBEAF0CE3 | URL: www.pobox.com/~tmz/pgp
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I could never recommend the use of drugs or alcohol to anyone, but
they've always worked for me.
-- Hunter S. Thompson
Todd Zullinger wrote:
> James,
>
> I forgot to mention that these patches are available at
> git://jet.mox.net/~tmz/puppet.git on the feature/master/initscripts
> branch.
>
Todd
Can you open a ticket for these and I'll mark it for 0.25.0.
Thanks
James Turnbull
- --
Author of:
* Pro Linux Systems Administration (http://tinyurl.com/linuxadmin)
* Pulling Strings with Puppet (http://tinyurl.com/pupbook)
* Pro Nagios 2.0 (http://tinyurl.com/pronagios)
* Hardening Linux (http://tinyurl.com/hardeninglinux)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFKgLkr9hTGvAxC30ARAgkKAKCVMM4WRHfe5GVge8nHNdtwcr8lTwCgn9hq
WC1z5TjyKC/Te/R+sGes6Gg=
=T48S
-----END PGP SIGNATURE-----
James Turnbull wrote:
> Can you open a ticket for these and I'll mark it for 0.25.0.
I updated http://projects.reductivelabs.com/issues/2123 for the first
patch and created http://projects.reductivelabs.com/issues/2526 for
the second. Both are marked with 0.25.0 as the target version.
--
Todd OpenPGP -> KeyID: 0xBEAF0CE3 | URL: www.pobox.com/~tmz/pgp
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sometimes I wonder whether the world is being run by smart people who
are putting us on or by imbeciles who really mean it.
-- Mark Twain