[PATCH/puppet 0/3] Updates to Red Hat config files

7 views
Skip to first unread message

Todd Zullinger

unread,
Jul 13, 2010, 1:58:56 PM7/13/10
to puppe...@googlegroups.com
These are a few minor updates to the conf/redhat files for 2.6.0. The
last patch is something I've submitted previously but hasn't been
included yet.

Todd Zullinger (3):
conf/redhat: Rebase rundir-perms patch
conf/redhat: Update conf/init files for single binary
conf/redhat: Consistently pass pidfile option to daemon, killproc,
and status

conf/redhat/client.init | 19 +++++++++++--------
conf/redhat/puppet.conf | 2 +-
conf/redhat/rundir-perms.patch | 26 +++++++++++++-------------
conf/redhat/server.init | 16 +++++++++++-----
4 files changed, 36 insertions(+), 27 deletions(-)

Todd Zullinger

unread,
Jul 13, 2010, 1:58:57 PM7/13/10
to puppe...@googlegroups.com
---
conf/redhat/rundir-perms.patch | 26 +++++++++++++-------------
1 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/conf/redhat/rundir-perms.patch b/conf/redhat/rundir-perms.patch
index a4cc94b..445b6cf 100644
--- a/conf/redhat/rundir-perms.patch
+++ b/conf/redhat/rundir-perms.patch
@@ -1,6 +1,6 @@
-From 9c4f335261aa48b6a2b82e91d4d6fcd95f030d09 Mon Sep 17 00:00:00 2001
+From b153b4d234cd015efb52a5db8075350a75506668 Mon Sep 17 00:00:00 2001
From: Jeroen van Meeuwen (Fedora Unity) <kan...@fedoraunity.org>
-Date: Fri, 4 Sep 2009 09:13:19 -0400
+Date: Sat, 10 Jul 2010 14:44:04 -0400
Subject: [PATCH/puppet] Tighten rundir perms (rhbz #495096)

The loose default permissions are not required for Red Hat systems
@@ -11,18 +11,18 @@ service user/group.
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/puppet/defaults.rb b/lib/puppet/defaults.rb
-index 3a0feec..3132830 100644
+index 0af40f2..71027d6 100644
--- a/lib/puppet/defaults.rb
+++ b/lib/puppet/defaults.rb
-@@ -62,7 +62,7 @@ module Puppet
- },
- :rundir => {
- :default => rundir,
-- :mode => 01777,
-+ :mode => 0755,
- :desc => "Where Puppet PID files are kept."
- },
- :genconfig => [false,
+@@ -26,7 +26,7 @@ module Puppet
+ },
+ :rundir => {
+ :default => Puppet.run_mode.run_dir,
+- :mode => 01777,
++ :mode => 0755,
+ :desc => "Where Puppet PID files are kept."
+ },
+ :genconfig => [false,
--
-1.6.4.2
+1.7.1

--
1.7.1

Todd Zullinger

unread,
Jul 13, 2010, 1:58:58 PM7/13/10
to puppe...@googlegroups.com
---
conf/redhat/client.init | 2 +-
conf/redhat/puppet.conf | 2 +-
conf/redhat/server.init | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/conf/redhat/client.init b/conf/redhat/client.init
index 0c98383..04e0d27 100644
--- a/conf/redhat/client.init
+++ b/conf/redhat/client.init
@@ -15,7 +15,7 @@ export PATH

[ -f /etc/sysconfig/puppet ] && . /etc/sysconfig/puppet
lockfile=${LOCKFILE-/var/lock/subsys/puppet}
-pidfile=${PIDFILE-/var/run/puppet/puppetd.pid}
+pidfile=${PIDFILE-/var/run/puppet/agent.pid}
puppetd=${PUPPETD-/usr/sbin/puppetd}
RETVAL=0

diff --git a/conf/redhat/puppet.conf b/conf/redhat/puppet.conf
index d35593f..47501a3 100644
--- a/conf/redhat/puppet.conf
+++ b/conf/redhat/puppet.conf
@@ -11,7 +11,7 @@
# The default value is '$confdir/ssl'.
ssldir = $vardir/ssl

-[puppetd]
+[agent]
# The file in which puppetd stores a list of the classes
# associated with the retrieved configuratiion. Can be loaded in
# the separate ``puppet`` executable using the ``--loadclasses``
diff --git a/conf/redhat/server.init b/conf/redhat/server.init
index 4f44206..3d2897d 100644
--- a/conf/redhat/server.init
+++ b/conf/redhat/server.init
@@ -13,7 +13,7 @@ PATH=/usr/bin:/sbin:/bin:/usr/sbin
export PATH

lockfile=/var/lock/subsys/puppetmaster
-pidfile=/var/run/puppet/puppetmasterd.pid
+pidfile=/var/run/puppet/master.pid

# Source function library.
. /etc/rc.d/init.d/functions
--
1.7.1

Todd Zullinger

unread,
Jul 13, 2010, 1:58:59 PM7/13/10
to puppe...@googlegroups.com
In Red Hat bug #531116 Ruben Kerkhof noted that we weren't using the
--pidfile $pidfile option to daemon. This caused 'service puppet start'
to fail if puppet had already been started. To be consistent, we now
pass the pidfile option to daemon, killproc, and status when those
functions provide such an option. And we only test for the availability
of the -p/--pidfile option in one place.
---
conf/redhat/client.init | 17 ++++++++++-------
conf/redhat/server.init | 14 ++++++++++----
2 files changed, 20 insertions(+), 11 deletions(-)

diff --git a/conf/redhat/client.init b/conf/redhat/client.init
index 04e0d27..f624d81 100644
--- a/conf/redhat/client.init
+++ b/conf/redhat/client.init
@@ -27,8 +27,12 @@ PUPPET_OPTS=""
[ -n "$PUPPET_LOG" ] && PUPPET_OPTS="${PUPPET_OPTS} --logdest=${PUPPET_LOG}"
[ -n "$PUPPET_PORT" ] && PUPPET_OPTS="${PUPPET_OPTS} --masterport=${PUPPET_PORT}"

-# Determine if we can use the -p option to killproc. RHEL < 5 can't.
-killproc | grep -q -- '-p' 2>/dev/null && killopts="-p $pidfile"
+# Determine if we can use the -p option to daemon, killproc, and status.
+# RHEL < 5 can't.
+if status | grep -q -- '-p' 2>/dev/null; then
+ daemonopts="--pidfile $pidfile"
+ pidopts="-p $pidfile"
+fi

# Figure out if the system just booted. Let's assume
# boot doesn't take longer than 5 minutes
@@ -37,7 +41,7 @@ killproc | grep -q -- '-p' 2>/dev/null && killopts="-p $pidfile"

start() {
echo -n $"Starting puppet: "
- daemon $puppetd ${PUPPET_OPTS} ${PUPPET_EXTRA_OPTS}
+ daemon $daemonopts $puppetd ${PUPPET_OPTS} ${PUPPET_EXTRA_OPTS}
RETVAL=$?
echo
[ $RETVAL = 0 ] && touch ${lockfile}
@@ -46,7 +50,7 @@ start() {

stop() {
echo -n $"Stopping puppet: "
- killproc $killopts $puppetd
+ killproc $pidopts $puppetd
RETVAL=$?
echo
[ $RETVAL = 0 ] && rm -f ${lockfile} ${pidfile}
@@ -54,7 +58,7 @@ stop() {

reload() {
echo -n $"Restarting puppet: "
- killproc $killopts $puppetd -HUP
+ killproc $pidopts $puppetd -HUP
RETVAL=$?
echo
return $RETVAL
@@ -66,8 +70,7 @@ restart() {
}

rh_status() {
- status | grep -q -- '-p' 2>/dev/null && statusopts="-p $pidfile"
- status $statusopts $puppetd
+ status $pidopts $puppetd
RETVAL=$?
return $RETVAL
}
diff --git a/conf/redhat/server.init b/conf/redhat/server.init
index 3d2897d..4d3a72c 100644
--- a/conf/redhat/server.init
+++ b/conf/redhat/server.init
@@ -33,6 +33,13 @@ fi
PUPPETMASTER_OPTS="${PUPPETMASTER_OPTS} \
${PUPPETMASTER_EXTRA_OPTS}"

+# Determine if we can use the -p option to daemon, killproc, and status.
+# RHEL < 5 can't.
+if status | grep -q -- '-p' 2>/dev/null; then
+ daemonopts="--pidfile $pidfile"
+ pidopts="-p $pidfile"
+fi
+
RETVAL=0

prog=puppetmasterd
@@ -50,7 +57,7 @@ start() {
ret=$?; [ $ret != 0 ] && RETVAL=$ret
done
else
- daemon $PUPPETMASTER $PUPPETMASTER_OPTS
+ daemon $daemonopts $PUPPETMASTER $PUPPETMASTER_OPTS
RETVAL=$?
fi
else
@@ -72,8 +79,7 @@ stop() {
ret=$?; [ $ret != 0 ] && RETVAL=$ret
done
else
- killproc | grep -q -- '-p' 2>/dev/null && killopts="-p $pidfile"
- killproc $killopts $PUPPETMASTER
+ killproc $pidopts $PUPPETMASTER
RETVAL=$?
fi
echo
@@ -99,7 +105,7 @@ rh_status() {
ret=$?; [ $ret != 0 ] && RETVAL=$ret
done
else
- status $PUPPETMASTER
+ status $pidopts $PUPPETMASTER
RETVAL=$?
fi
return $RETVAL
--
1.7.1

James Turnbull

unread,
Jul 13, 2010, 2:20:25 PM7/13/10
to puppe...@googlegroups.com

Awesome. Can you please create a ticket and add your branch and mark as
Ready for Testing and we'll sweep it into RC3.

James

--
Puppet Labs - http://www.puppetlabs.com
C: 503-734-8571

Todd Zullinger

unread,
Jul 13, 2010, 2:39:52 PM7/13/10
to puppe...@googlegroups.com
James Turnbull wrote:
> Awesome. Can you please create a ticket and add your branch and
> mark as Ready for Testing and we'll sweep it into RC3.

Done: http://projects.puppetlabs.com/issues/4223

--
Todd OpenPGP -> KeyID: 0xBEAF0CE3 | URL: www.pobox.com/~tmz/pgp
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Going to trial with a lawyer who considers your whole life-style a
Crime in Progress is not a happy prospect.
-- Hunter S. Thompson

Reply all
Reply to author
Forward
0 new messages