On Thu, 18 Jan 2001, Thomas Ribbrock wrote:
> Hi folks,
>
> there's something I've been wondering about for a while: On my network,
> I have an OpenBSD box, a RH 5.2 box and two RH 6.2 boxes. I'm using ssh
> between them all the time (ftp/telnet both disabled). If I log in
> remotely (from a terminal window on a RH box) into the OpenBSD box and shut
> it down (shutdown -h now), the box shuts down and the remote session gets
> terminated properly without me having to log off explicitly.
> If I do the same thing with any of the RH boxes, the ssh session simply
> freezes when the remote box has shut down and I have to explicitly kill it
> or close the terminal window.
>
> Is there any way to get the RH boxes to shut down their network services
> gracefully on system shutdown (like the OpenBSD box)?
>
Well.. I don't have a openbsd box but... :) Redhat init scripts generally
only killed the master/parent process. That is, it only kills the pid
contained in /var/run/sshd.pid. Personally I concider that a good thing
becuase it means I can restart the ssh daemon while logged in via ssh and
not go "ow! ow! ow! me foot! me foot!" But if you want it to kill all the
processes and not just the master try editing /etc/rc.d/init.d/sshd and
change...
echo -n "Shutting down sshd: "
if [ -f $PID_FILE ] ; then
killproc sshd
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/sshd
fi
... to ...
echo -n "Shutting down sshd: "
if [ -f $PID_FILE ] ; then
killall sshd; RETVAL = $?
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/sshd
fi
... then all your ssh sessions should be cleanly termed and not be hanging
around when the network card is turned off. There will probably be
differences in your init scripts between the 5.2 and 6.2 boxes depending on
where you got your ssh install from but that should be the generael gist of
it.
M.
--
WebCentral Pty Ltd Australia's #1 Internet Web Hosting Company
Level 1, 96 Lytton Road. Network Operations - Systems Engineer
PO Box 4169, East Brisbane. phone: +61 7 3249 2583
Queensland, Australia. pgp key id: 0x900E515F
_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list