summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlutter <lutter@980ebf18-57e1-0310-9a29-db15c13687c0>2006-01-30 23:14:31 +0000
committerlutter <lutter@980ebf18-57e1-0310-9a29-db15c13687c0>2006-01-30 23:14:31 +0000
commitd5af359e52559efecccdf807ea5dfef8230f7cd3 (patch)
treedd30a5a06e2687811383389b3292dc7c108b7367
parent6637bb60e591ff05e5b5acb3910715149be7d97c (diff)
downloadpuppet-d5af359e52559efecccdf807ea5dfef8230f7cd3.tar.gz
puppet-d5af359e52559efecccdf807ea5dfef8230f7cd3.tar.xz
puppet-d5af359e52559efecccdf807ea5dfef8230f7cd3.zip
Rewrote client init script since puppetd is now a proper demon.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@861 980ebf18-57e1-0310-9a29-db15c13687c0
-rw-r--r--conf/redhat/client.cron24
-rw-r--r--conf/redhat/client.init39
-rw-r--r--conf/redhat/puppet.spec4
3 files changed, 26 insertions, 41 deletions
diff --git a/conf/redhat/client.cron b/conf/redhat/client.cron
deleted file mode 100644
index cb309585d..000000000
--- a/conf/redhat/client.cron
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/sh
-
-if [ -f /etc/sysconfig/puppet ]; then
- . /etc/sysconfig/puppet
-fi
-
-# The server must be specified explicitly
-if [ -z "${PUPPET_SERVER}" ]; then
- echo $"No puppet server specified."
- return 1
-fi
-
-[ -z "$PUPPET_LOG" ] && PUPPET_LOG="/var/log/puppet.log"
-[ -z "$PUPPET_PORT" ] && PUPPET_PORT=8139
-PUPPET_OPTS="\
- --server=$PUPPET_SERVER \
- --port=$PUPPET_PORT \
- --logdest=$PUPPET_LOG \
- $PUPPET_EXTRA_OPTS"
-
-# Run if puppet is enabled
-if [ -f /var/lock/subsys/puppet ]; then
- /usr/sbin/puppetd ${PUPPET_OPTS}
-fi
diff --git a/conf/redhat/client.init b/conf/redhat/client.init
index b71650702..c70b95899 100644
--- a/conf/redhat/client.init
+++ b/conf/redhat/client.init
@@ -1,7 +1,8 @@
#!/bin/bash
-# puppet This shell script enables system auto-conf through puppet.
+# puppet Init script for running the puppet client daemon
#
# Author: Duane Griffin <d.griffin@psenterprise.com>
+# David Lutterkort <dlutter@redhat.com>
#
# chkconfig: - 98 02
#
@@ -11,25 +12,35 @@
PATH=/usr/bin:/sbin:/bin:/usr/sbin
export PATH
-lockfile=/var/lock/subsys/puppet
+[ -f /etc/sysconfig/puppet ] && . /etc/sysconfig/puppet
+lockfile=${LOCKFILE-/var/lock/subsys/puppet}
+pidfile=${PIDFILE-/var/run/puppet.pid}
+puppetd=${PUPPETD-/usr/sbin/puppetd}
+RETVAL=0
# Source function library.
. /etc/rc.d/init.d/functions
-RETVAL=0
+PUPPET_OPTS=""
+[ -n "${PUPPET_SERVER}" ] && PUPPET_OPTS="--server=${PUPPET_SERVER}"
+[ -n "$PUPPET_LOG" ] && PUPPET_OPTS="${PUPPET_OPTS} --logdest=${PUPPET_LOG}"
+[ -n "$PUPPET_PORT" ] && PUPPET_OPTS="${PUPPET_OPTS} --port=${PUPPET_PORT}"
start() {
- echo -n $"Enabling hourly puppet update: "
- touch "$lockfile" && success || failure
+ echo -n $"Starting puppetd: "
+ daemon $puppetd ${PUPPET_OPTS} ${PUPPET_EXTRA_OPTS}
RETVAL=$?
echo
+ [ $RETVAL = 0 ] && touch ${lockfile}
+ return $RETVAL
}
stop() {
- echo -n $"Disabling hourly puppet update: "
- rm -f "$lockfile" && success || failure
+ echo -n $"Stopping puppetd: "
+ killproc $puppetd
RETVAL=$?
echo
+ [ $RETVAL = 0 ] && rm -f ${lockfile} ${pidfile}
}
restart() {
@@ -48,19 +59,19 @@ case "$1" in
restart
;;
reload)
+ restart
;;
condrestart)
- [ -f "$lockfile" ] && restart
+ [ -f "$pidfile" ] && restart
;;
status)
- if [ -f "$lockfile" ]; then
- echo $"Hourly puppet update is enabled."
- else
- echo $"Hourly puppet update is disabled."
- fi
+ status $puppetd
;;
+ once)
+ $puppetd -o ${PUPPET_OPTS} ${PUPPET_EXTRA_OPTS}
+ ;;
*)
- echo $"Usage: $0 {start|stop|status|restart|reload|force-reload|condrestart}"
+ echo $"Usage: $0 {start|stop|status|restart|reload|force-reload|condrestart|once}"
exit 1
esac
diff --git a/conf/redhat/puppet.spec b/conf/redhat/puppet.spec
index f593fbe27..6925ef1ea 100644
--- a/conf/redhat/puppet.spec
+++ b/conf/redhat/puppet.spec
@@ -4,7 +4,7 @@
Summary: A network tool for managing many disparate systems
Name: puppet
-Version: 0.12.0
+Version: 0.12.0.1
Release: 1
License: GPL
Group: System Environment/Base
@@ -52,7 +52,6 @@ The server can also function as a certificate authority and file server.
%{__cp} -a %{_pbuild}/lib/puppet %{buildroot}%{rubylibdir}
%{__install} -Dp -m0644 %{confdir}/client.sysconfig %{buildroot}%{_sysconfdir}/sysconfig/puppet
%{__install} -Dp -m0755 %{confdir}/client.init %{buildroot}%{_initrddir}/puppet
-%{__install} -Dp -m0644 %{confdir}/client.cron %{buildroot}%{_sysconfdir}/cron.hourly/puppet.cron
%{__install} -Dp -m0644 %{confdir}/server.sysconfig %{buildroot}%{_sysconfdir}/sysconfig/puppetmaster
%{__install} -Dp -m0755 %{confdir}/server.init %{buildroot}%{_initrddir}/puppetmaster
%{__install} -Dp -m0644 %{confdir}/fileserver.conf %{buildroot}%{_sysconfdir}/puppet/fileserver.conf
@@ -64,7 +63,6 @@ The server can also function as a certificate authority and file server.
%{rubylibdir}/*
%{_localstatedir}/puppet
%config %{_initrddir}/puppet
-%config %{_sysconfdir}/cron.hourly/puppet.cron
%config(noreplace) %{_sysconfdir}/sysconfig/puppet
%doc CHANGELOG COPYING LICENSE README TODO examples
%exclude %{_sbindir}/puppetdoc