OpenSSH-1.12pre15: PATCH: packages/redhat/sshd.init

Jim Knoble jmknoble at pobox.com
Mon Dec 6 15:28:17 EST 1999


The ChangeLog indicates:

  19991113
   [...]
   - Revised Redhat initscript to fix bug: sshd (re)start would fail
      if executed from inside a ssh login.

Unfortunately, the changes made to the init script make it no longer
work on a Red Hat Linux 4.x or 5.x system, which doesn't use the
`success' or `failure' functions available in Red Hat Linux 6.x.

The attached patch enables the script to work in either environment by
checking for the existence of the `success' shell function.

-- 
jim knoble
jmknoble at pobox.com
-------------- next part --------------
--- ./packages/redhat/sshd.init.orig-init	Mon Nov 22 18:11:29 1999
+++ ./packages/redhat/sshd.init	Sun Dec  5 02:06:27 1999
@@ -21,8 +21,16 @@
   start)
 	echo -n "Starting sshd: "
 	if [ ! -f /var/run/sshd.pid ] ; then
-   	/usr/sbin/sshd && success "sshd startup" || failure "sshd startup"
-		RETVAL=$?
+	  case "`type -type success`" in
+	    function)
+	      /usr/sbin/sshd && success "sshd startup" || failure "sshd startup"
+	      RETVAL=$?
+	    ;;
+	    *)
+	      /usr/sbin/sshd && echo -n "sshd "
+	      RETVAL=$?
+	    ;;
+	  esac
 	fi
 	echo
 	;;


More information about the openssh-unix-dev mailing list