Repair initscript to be acord to guidelines

This commit is contained in:
Jan F. Chadima 2009-09-24 16:05:27 +00:00
parent cee78eb11c
commit f013bee3ec
2 changed files with 15 additions and 14 deletions

View File

@ -63,7 +63,7 @@
Summary: An open source implementation of SSH protocol versions 1 and 2 Summary: An open source implementation of SSH protocol versions 1 and 2
Name: openssh Name: openssh
Version: 5.2p1 Version: 5.2p1
Release: 27%{?dist}%{?rescue_rel} Release: 28%{?dist}%{?rescue_rel}
URL: http://www.openssh.com/portable.html URL: http://www.openssh.com/portable.html
#Source0: ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-%{version}.tar.gz #Source0: ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-%{version}.tar.gz
#Source1: ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-%{version}.tar.gz.asc #Source1: ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-%{version}.tar.gz.asc
@ -466,7 +466,7 @@ fi
%endif %endif
%changelog %changelog
* Thu Sep 24 2009 Jan F. Chadima <jchadima@redhat.com> - 5.2p1-27 * Thu Sep 24 2009 Jan F. Chadima <jchadima@redhat.com> - 5.2p1-28
- Repair initscript to be acord to guidelines (#521860) - Repair initscript to be acord to guidelines (#521860)
- Add bugzilla# to application of edns and xmodifiers patch - Add bugzilla# to application of edns and xmodifiers patch

View File

@ -107,7 +107,7 @@ do_restart_sanity_check()
{ {
$SSHD -t $SSHD -t
RETVAL=$? RETVAL=$?
if [ ! "$RETVAL" = 0 ]; then if [ $RETVAL -ne 0 ]; then
failure $"Configuration file or keys are invalid" failure $"Configuration file or keys are invalid"
echo echo
fi fi
@ -127,7 +127,7 @@ start()
echo -n $"Starting $prog: " echo -n $"Starting $prog: "
$SSHD $OPTIONS && success || failure $SSHD $OPTIONS && success || failure
RETVAL=$? RETVAL=$?
[ "$RETVAL" = 0 ] && touch $lockfile [ $RETVAL -eq 0 ] && touch $lockfile
echo echo
return $RETVAL return $RETVAL
} }
@ -148,7 +148,7 @@ stop()
killall $prog 2>/dev/null killall $prog 2>/dev/null
trap TERM trap TERM
fi fi
[ "$RETVAL" = 0 ] && rm -f $lockfile [ $RETVAL -eq 0 ] && rm -f $lockfile
echo echo
} }
@ -174,7 +174,7 @@ force_reload() {
} }
rh_status() { rh_status() {
status -p $PID_FILE $prog #openssh-daemon status -p $PID_FILE openssh-daemon
} }
rh_status_q() { rh_status_q() {
@ -187,7 +187,10 @@ case "$1" in
start start
;; ;;
stop) stop)
rh_status_q || exit 0 if ! rh_status_q; then
rm -f $lockfile
exit 0
fi
stop stop
;; ;;
restart) restart)
@ -200,16 +203,11 @@ case "$1" in
force-reload) force-reload)
force_reload force_reload
;; ;;
condrestart) condrestart|try-restart)
if [ -f /var/lock/subsys/$prog ]; then
restart
fi
;;
try-restart)
rh_status_q || exit 0 rh_status_q || exit 0
if [ -f $lockfile ] ; then if [ -f $lockfile ] ; then
do_restart_sanity_check do_restart_sanity_check
if [ "$RETVAL" = 0 ] ; then if [ $RETVAL -eq 0 ] ; then
stop stop
# avoid race # avoid race
sleep 3 sleep 3
@ -222,6 +220,9 @@ case "$1" in
status) status)
rh_status rh_status
RETVAL=$? RETVAL=$?
if [ $RETVAL -eq 3 -a -f $lockfile ] ; then
RETVAL=2
fi
;; ;;
*) *)
echo $"Usage: $0 {start|stop|restart|reload|force-reload|condrestart|try-restart|status}" echo $"Usage: $0 {start|stop|restart|reload|force-reload|condrestart|try-restart|status}"