summaryrefslogtreecommitdiff
path: root/ext/suse
diff options
context:
space:
mode:
authorMatthaus Owens <matthaus@puppetlabs.com>2012-10-08 15:52:03 -0700
committerJosh Cooper <josh@puppetlabs.com>2012-10-08 16:44:25 -0700
commitc44379f4a5c8499067cb71bc43ccdffb07729779 (patch)
treebb4e669a554a2c34c68699d29ed08077c25e6ecd /ext/suse
parent5674ba1b340407deaeaf607c25429e82d29c4e9c (diff)
downloadpuppet-c44379f4a5c8499067cb71bc43ccdffb07729779.tar.gz
(#16801) Update suse server.init and remove mongrel refs
The binary used to start the puppetmaster process has changed in Puppet 3.0, as has the pidfile location. Built-in mongrel support has also been removed. This commit adds a warning if mongrel settings are detected and also updates calls to startproc, checkproc, and killproc to use a pidfile to ensure the correct process is used, and not the `puppet agent` process. It also updates the pidfile location to match reality and adds master to the PUPPETMASTER_OPTS so the correct application is started.
Diffstat (limited to 'ext/suse')
-rw-r--r--ext/suse/server.init40
1 files changed, 25 insertions, 15 deletions
diff --git a/ext/suse/server.init b/ext/suse/server.init
index 50b9fef81..68e71f627 100644
--- a/ext/suse/server.init
+++ b/ext/suse/server.init
@@ -31,7 +31,7 @@
# rc_exit exit appropriate to overall rc status
lockfile=/var/lock/subsys/puppetmaster
-pidfile=/var/run/puppet/puppetmasterd.pid
+pidfile=/var/run/puppet/master.pid
# Source function library.
[ -f /etc/rc.status ] && . /etc/rc.status
@@ -40,19 +40,28 @@ if [ -f /etc/sysconfig/puppetmaster ]; then
. /etc/sysconfig/puppetmaster
fi
-PUPPETMASTER_OPTS=""
-[ -n "$PUPPETMASTER_MANIFEST" ] && PUPPETMASTER_OPTS="--manifest=${PUPPETMASTER_MANIFEST}"
-if [ -n "$PUPPETMASTER_PORTS" ] && [ ${#PUPPETMASTER_PORTS[@]} -gt 1 ]; then
- PUPPETMASTER_OPTS="$PUPPETMASTER_OPTS --servertype=mongrel"
-elif [ -n "$PUPPETMASTER_PORTS" ] && [ ${#PUPPETMASTER_PORTS[@]} -eq 1 ]; then
- PUPPETMASTER_OPTS="${PUPPETMASTER_OPTS} --masterport=${PUPPETMASTER_PORTS[0]}"
-fi
+PUPPETMASTER_OPTS="master "
+[ -n "$PUPPETMASTER_MANIFEST" ] && PUPPETMASTER_OPTS="${PUPPETMASTER_OPTS} --manifest=${PUPPETMASTER_MANIFEST}"
+[ -n "$PUPPETMASTER_PORTS" ] && PUPPETMASTER_OPTS="${PUPPETMASTER_OPTS} --masterport=${PUPPETMASTER_PORTS[0]}"
[ -n "$PUPPETMASTER_LOG" ] && PUPPETMASTER_OPTS="${PUPPETMASTER_OPTS} --logdest ${PUPPETMASTER_LOG}"
PUPPETMASTER_OPTS="${PUPPETMASTER_OPTS} \
${PUPPETMASTER_EXTRA_OPTS}"
-prog=puppetmasterd
-PUPPETMASTER=/usr/sbin/$prog
+RETVAL=0
+
+PUPPETMASTER=/usr/bin/puppet
+
+mongrel_warning="The mongrel servertype is no longer built-in to Puppet. It appears
+as though mongrel is being used, as the number of ports is greater than
+one. Starting the puppetmaster service will not behave as expected until this
+is resolved. Only the first port has been used in the service. These settings
+are defined at /etc/sysconfig/puppetmaster"
+
+# Warn about removed and unsupported mongrel servertype
+if [ -n "$PUPPETMASTER_PORTS" ] && [ ${#PUPPETMASTER_PORTS[@]} -gt 1 ]; then
+ echo $mongrel_warning
+ echo
+fi
start() {
echo -n $"Starting puppetmaster: "
@@ -60,6 +69,7 @@ start() {
echo
return $RETVAL
}
+
# First reset status of this service
rc_reset
@@ -87,7 +97,7 @@ case "$1" in
# already running to match LSB spec.
# Confirm the manifest exists
if [ -r $PUPPETMASTER_MANIFEST ]; then
- startproc $PUPPETMASTER $PUPPETMASTER_OPTS && touch "$lockfile"
+ startproc -p ${pidfile} $PUPPETMASTER $PUPPETMASTER_OPTS && touch "$lockfile"
else
rc_failed
echo "Manifest does not exist: $PUPPETMASTER_MANIFEST"
@@ -100,7 +110,7 @@ case "$1" in
## Stop daemon with killproc(8) and if this fails
## set echo the echo return value.
- killproc -QUIT $PUPPETMASTER && rm -f ${lockfile} ${pidfile}
+ killproc -QUIT -p ${pidfile} $PUPPETMASTER && rm -f ${lockfile} ${pidfile}
# Remember status and be verbose
rc_status -v
@@ -129,7 +139,7 @@ case "$1" in
echo -n "Reload service puppet"
## if it supports it:
- killproc -HUP $PUPPETMASTER
+ killproc -HUP -p ${pidfile} $PUPPETMASTER
rc_status -v
;;
reload)
@@ -138,7 +148,7 @@ case "$1" in
# If it supports signalling:
echo -n "Reload puppet services."
- killproc -HUP $PUPPETMASTER
+ killproc -HUP -p ${pidfile} $PUPPETMASTER
rc_status -v
;;
status)
@@ -153,7 +163,7 @@ case "$1" in
# 3 - service not running
# NOTE: checkproc returns LSB compliant status values.
- checkproc $PUPPETMASTER
+ checkproc -p ${pidfile} $PUPPETMASTER
rc_status -v
;;
*)