conf/redhat/client.init: Fix #2123, status options on older RHEL

On RHEL < 5, the status function does not accept a -p option.  Using it
causes 'service puppet status' to produce erroneous output.  This was
also reported by Aaron Dummer in Red Hat bug #501577.

Signed-off-by: Todd Zullinger <tmz@pobox.com>
This commit is contained in:
Todd Zullinger 2009-08-06 12:34:56 -04:00 коммит произвёл James Turnbull
Родитель 0461a0250d
Коммит e9fbd4c9a2
1 изменённых файлов: 6 добавлений и 2 удалений

Просмотреть файл

@ -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