diff options
author | Todd Zullinger <tmz@pobox.com> | 2010-10-11 17:30:33 -0400 |
---|---|---|
committer | Todd Zullinger <tmz@pobox.com> | 2010-10-11 17:30:33 -0400 |
commit | 706973625db23d369cf3198f36778af93e280490 (patch) | |
tree | 7fbec9cfcc5fb0c6f9691ff7e1f32657e15ef698 | |
parent | 22060e81bf3ca9ccc80aa001a04157916efc02af (diff) | |
download | puppet-package-706973625db23d369cf3198f36778af93e280490.tar.gz puppet-package-706973625db23d369cf3198f36778af93e280490.tar.xz puppet-package-706973625db23d369cf3198f36778af93e280490.zip |
Backport a number of fixes from upstream
-rw-r--r-- | puppet-0.25.5-dbconnections-options.patch | 77 | ||||
-rw-r--r-- | puppet-0.25.5-pidfile-option.patch | 121 | ||||
-rw-r--r-- | puppet-0.25.5-puppet.conf-line-endings.patch | 33 | ||||
-rw-r--r-- | puppet-0.25.5-yumrepo-deprecation-warning.patch | 25 | ||||
-rw-r--r-- | puppet.spec | 28 |
5 files changed, 283 insertions, 1 deletions
diff --git a/puppet-0.25.5-dbconnections-options.patch b/puppet-0.25.5-dbconnections-options.patch new file mode 100644 index 0000000..3bfbb08 --- /dev/null +++ b/puppet-0.25.5-dbconnections-options.patch @@ -0,0 +1,77 @@ +From d55c11d0d42b1b770348b8fb6e1d4d05d607183f Mon Sep 17 00:00:00 2001 +From: Richard Soderberg <rs@pi007.sv2.upperbeyond.com> +Date: Mon, 24 Aug 2009 19:57:07 -0700 +Subject: [PATCH/puppet] Fixed #2568 - Add database option 'dbconnections' + +This sets the ActiveRecords connection pool size, when connecting to remote databases (mysql, postgres). default is 0; the 'pool' argument is only passed to ActiveRecords when the value is 1 or greater. + +(Cherry-picked from the 2.6.x branch -- tmz) +--- + ext/puppetstoredconfigclean.rb | 2 ++ + lib/puppet/defaults.rb | 3 +++ + lib/puppet/rails.rb | 3 +++ + man/man5/puppet.conf.5 | 7 +++++++ + 4 files changed, 15 insertions(+), 0 deletions(-) + +diff --git a/ext/puppetstoredconfigclean.rb b/ext/puppetstoredconfigclean.rb +index 6538192..85e1c0e 100644 +--- a/ext/puppetstoredconfigclean.rb ++++ b/ext/puppetstoredconfigclean.rb +@@ -66,6 +66,8 @@ case adapter + args[:database] = pm_conf[:dbname] unless pm_conf[:dbname].to_s.empty? + socket = pm_conf[:dbsocket] + args[:socket] = socket unless socket.to_s.empty? ++ connections = pm_conf[:dbconnections].to_i ++ args[:pool] = connections if connections > 0 + else + raise ArgumentError, "Invalid db adapter %s" % adapter + end +diff --git a/lib/puppet/defaults.rb b/lib/puppet/defaults.rb +index e446a23..6d0208b 100644 +--- a/lib/puppet/defaults.rb ++++ b/lib/puppet/defaults.rb +@@ -683,6 +683,9 @@ module Puppet + used when networked databases are used."], + :dbsocket => [ "", "The database socket location. Only used when networked + databases are used. Will be ignored if the value is an empty string."], ++ :dbconnections => [ 0, "The number of database connections. Only used when ++ networked databases are used. Will be ignored if the value is an empty ++ string or is less than 1."], + :railslog => {:default => "$logdir/rails.log", + :mode => 0600, + :owner => "service", +diff --git a/lib/puppet/rails.rb b/lib/puppet/rails.rb +index 98c0e3d..1ad602c 100644 +--- a/lib/puppet/rails.rb ++++ b/lib/puppet/rails.rb +@@ -58,6 +58,9 @@ module Puppet::Rails + + socket = Puppet[:dbsocket] + args[:socket] = socket unless socket.empty? ++ ++ connections = Puppet[:dbconnections].to_i ++ args[:pool] = connections if connections > 0 + else + raise ArgumentError, "Invalid db adapter %s" % adapter + end +diff --git a/man/man5/puppet.conf.5 b/man/man5/puppet.conf.5 +index ff9b889..abfa5dc 100644 +--- a/man/man5/puppet.conf.5 ++++ b/man/man5/puppet.conf.5 +@@ -418,6 +418,13 @@ The type of database to use. + . + \fBDefault\fP: sqlite3 + .UNINDENT ++.SS dbconnections ++The number of database connections. Only used when networked databases are used. Will be ignored if the value is an empty string or is less than 1. ++.INDENT 0.0 ++.IP \(bu 2 ++. ++\fBDefault\fP: 0 ++.UNINDENT + .SS dblocation + .sp + The database cache for client configurations. Used for querying within the language. +-- +1.7.2.1 + diff --git a/puppet-0.25.5-pidfile-option.patch b/puppet-0.25.5-pidfile-option.patch new file mode 100644 index 0000000..bc081da --- /dev/null +++ b/puppet-0.25.5-pidfile-option.patch @@ -0,0 +1,121 @@ +From 04228528d1f8e4d36e1643ac0cf51281b81ef9fb Mon Sep 17 00:00:00 2001 +From: Todd Zullinger <tmz@pobox.com> +Date: Tue, 27 Oct 2009 01:03:33 -0400 +Subject: [PATCH/puppet] conf/redhat: Consistently pass pidfile option to daemon, killproc, and status + +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.2.1 + diff --git a/puppet-0.25.5-puppet.conf-line-endings.patch b/puppet-0.25.5-puppet.conf-line-endings.patch new file mode 100644 index 0000000..570f2e1 --- /dev/null +++ b/puppet-0.25.5-puppet.conf-line-endings.patch @@ -0,0 +1,33 @@ +From 1e89bff59448bfc22c22f0b03bf965b7f4da0c77 Mon Sep 17 00:00:00 2001 +From: James Turnbull <james@lovedthanlost.net> +Date: Wed, 16 Jun 2010 03:22:17 +1000 +Subject: [PATCH/puppet] Fixes #3514 - CR/LF line ending in puppet.conf cause silent failure + +Patch thanks to Alan Barrett +--- + lib/puppet/util/settings.rb | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/lib/puppet/util/settings.rb b/lib/puppet/util/settings.rb +index 11d760f..2dedc31 100644 +--- a/lib/puppet/util/settings.rb ++++ b/lib/puppet/util/settings.rb +@@ -894,13 +894,13 @@ Generated on #{Time.now}. + text.split(/\n/).each { |line| + count += 1 + case line +- when /^\s*\[(\w+)\]$/ ++ when /^\s*\[(\w+)\]\s*$/ + section = $1.intern # Section names + # Add a meta section + result[section][:_meta] ||= {} + when /^\s*#/; next # Skip comments + when /^\s*$/; next # Skip blanks +- when /^\s*(\w+)\s*=\s*(.*)$/ # settings ++ when /^\s*(\w+)\s*=\s*(.*?)\s*$/ # settings + var = $1.intern + + # We don't want to munge modes, because they're specified in octal, so we'll +-- +1.7.2.1 + diff --git a/puppet-0.25.5-yumrepo-deprecation-warning.patch b/puppet-0.25.5-yumrepo-deprecation-warning.patch new file mode 100644 index 0000000..67fe4f2 --- /dev/null +++ b/puppet-0.25.5-yumrepo-deprecation-warning.patch @@ -0,0 +1,25 @@ +From 95231c6cac7359f6b8fa3f7a9b30a47e90861b4c Mon Sep 17 00:00:00 2001 +From: James Turnbull <james@lovedthanlost.net> +Date: Fri, 16 Jul 2010 14:42:01 +1000 +Subject: [PATCH/puppet] Fixed yumrepo type deprecation warning + +--- + lib/puppet/type/yumrepo.rb | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/lib/puppet/type/yumrepo.rb b/lib/puppet/type/yumrepo.rb +index 51ed17b..09dcad6 100644 +--- a/lib/puppet/type/yumrepo.rb ++++ b/lib/puppet/type/yumrepo.rb +@@ -86,7 +86,7 @@ module Puppet + clear + inifile.each_section do |s| + next if s.name == "main" +- obj = create(:name => s.name, :check => check) ++ obj = new(:name => s.name, :check => check) + current_values = obj.retrieve + obj.eachproperty do |property| + if current_values[property].nil? +-- +1.7.2.1 + diff --git a/puppet.spec b/puppet.spec index 5943e70..494e4e0 100644 --- a/puppet.spec +++ b/puppet.spec @@ -6,13 +6,27 @@ Name: puppet Version: 0.25.5 -Release: 1%{?dist} +Release: 2%{?dist} Summary: A network tool for managing many disparate systems License: GPLv2+ URL: http://puppetlabs.com Source0: http://puppetlabs.com/downloads/%{name}/%{name}-%{version}.tar.gz Source1: http://puppetlabs.com/downloads/%{name}/%{name}-%{version}.tar.gz.sign +# http://projects.puppetlabs.com/issues/show/4252 +# https://bugzilla.redhat.com/show_bug.cgi?id=615175 +Patch0: puppet-0.25.5-yumrepo-deprecation-warning.patch + +# http://projects.puppetlabs.com/issues/1856 +# https://bugzilla.redhat.com/show_bug.cgi?id=531116 +Patch1: puppet-0.25.5-pidfile-option.patch + +# http://projects.reductivelabs.com/issues/3514 +Patch2: puppet-0.25.5-puppet.conf-line-endings.patch + +# http://projects.puppetlabs.com/issues/2568 +Patch3: puppet-0.25.5-dbconnections-options.patch + Group: System Environment/Base BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -67,6 +81,10 @@ The server can also function as a certificate authority and file server. %prep %setup -q patch -p1 < conf/redhat/rundir-perms.patch +%patch0 -p1 +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 %build # Fix some rpmlint complaints @@ -91,6 +109,7 @@ rm -rf %{buildroot} ruby install.rb --destdir=%{buildroot} --quick --no-rdoc install -d -m0755 %{buildroot}%{_sysconfdir}/puppet/manifests +install -d -m0755 %{buildroot}%{_datadir}/%{name}/modules install -d -m0755 %{buildroot}%{_localstatedir}/lib/puppet install -d -m0755 %{buildroot}%{_localstatedir}/run/puppet install -d -m0750 %{buildroot}%{_localstatedir}/log/puppet @@ -221,6 +240,13 @@ fi rm -rf %{buildroot} %changelog +* Sat Aug 21 2010 Todd Zullinger <tmz@pobox.com> - 0.25.5-2 +- Create and own /usr/share/puppet/modules (#615432) +- Silence deprecation warnings in yumrepo type (#615175) +- Consistently pass pidfile option to daemon, killproc, and status (#531116) +- Handle CR/LF in puppet.conf (upstream #3514) +- Cherry-pick dbconnections option from 2.6.x branch (upstream #2568) + * Mon May 17 2010 Todd Zullinger <tmz@pobox.com> - 0.25.5-1 - Update to 0.25.5 - Adjust selinux conditional for EL-6 |