Bug 33851

Summary: OpenSSH 2.5 packages do not correctly restart the server
Product: [Retired] Red Hat Linux Reporter: Phil Mayers <p.mayers>
Component: opensshAssignee: Nalin Dahyabhai <nalin>
Status: CLOSED DUPLICATE QA Contact:
Severity: high Docs Contact:
Priority: medium    
Version: 7.0   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2001-03-29 14:38:43 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Phil Mayers 2001-03-29 14:38:40 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)


The OpenSSH-2.3.0p1-4 to openssh-2.5.2p2-1.7 RPM update dated Mar 27 does 
not correctly restart the sshd - when installed on a machine, if someone 
is logged in over SSH, the server will not restart. This did not happen 
with the 2.1.1p4-1 to 2.3 upgrade

Reproducible: Always
Steps to Reproduce:
1. Login over SSH
2. rpm -Uvh openssh-server-2.5.2p2-1.7.i386.rpm
3. ps faux | grep sshd
	

Actual Results:  The SSH daemon was not restarted, and remote logins to 
the machine were not possible.

Expected Results:  The SSH daemon would be correctly restarted :o)

The file /var/lock/subsys/sshd appears to still be present after upgrading 
from 2.3 to 2.5 - In fact...


After further investigation, here's what happened: In 2.3.0, the start 
function of the init script did this:

echo starting
/usr/sbin/sshd

Or something like that. The new init script does this:

echo starting
daemon /usr/sbin/sshd

This function (daemon) does this:

        # See if it's already running.
        pidlist=`pidofproc $1`

        pid=
        for apid in $pidlist ; do
           [ -d /proc/$apid ] && pid="$pid $apid"
        done

        [ -n "$pid" ] && return


So, if someone is logged in (say, with an SSH PID of 2345), this will 
happen:

pidlist <- "2345"
pid = " 2345"
[ -n "2345" ] && return

...And returns without starting the SSHD. In *fact*, this init script will 
*never* start SSHD if someone is logged in, since pidofproc will always 
return a value, and the shell above will fail to get past the return 
statement.

I'd pull the 2.5 package if I were you, and hope that all you downstream 
mirrors are checking for file removal (hint: www.mirror.ac.uk don't)



Regards,
Phil

+----------------------------------+
| Phil Mayers, Network Support     |
| Centre for Computing Services    |
| Imperial College                 |
+----------------------------------+

Comment 1 Bill Nottingham 2001-03-29 15:54:07 UTC

*** This bug has been marked as a duplicate of 33633 ***