Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 452026 - sshd should kill all sshd sessions when exiting to avoid hanging terminal sessions
Summary: sshd should kill all sshd sessions when exiting to avoid hanging terminal ses...
Status: RESOLVED DUPLICATE of bug 367553
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-14 12:51 UTC by Herbert Wantesh
Modified: 2013-01-17 09:34 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Herbert Wantesh 2013-01-14 12:51:10 UTC
sshd should kill all ssh sessions when exiting to avoid hanging terminal sessions

Reproducible: Always

Steps to Reproduce:
1.log in with ssh
2.reboot system
3.ssh connection is "dead"


Expected Results:  
when the system reboots ssh sessions should get killed

i allready found a fix for this just replace the stop function in the sshd initscript with this:

stop() {
        if [ "${RC_CMD}" = "restart" ] ; then
                checkconfig || return 1
        fi
        ebegin "Stopping ${SVCNAME}"
        if yesno $RC_REBOOT; then
#rebooting
                start-stop-daemon --stop -n "${SSHD_BINARY}" --quiet
        else
                start-stop-daemon --stop --exec "${SSHD_BINARY}" \
                        --pidfile "${SSHD_PIDFILE}" --quiet
        fi
        eend $?
}

as openrc introduced RC_REBOOT some time ago and its also used in the kexec init script it should be fine to use it here too
Comment 1 jannis 2013-01-14 13:04:48 UTC
have fun doing an "/etc/init.d/sshd restart" then ... Did you try to discuss this with the OpenSSH-devs (upstream)?
Comment 2 Lars Wendler (Polynomial-C) gentoo-dev 2013-01-14 13:05:29 UTC

*** This bug has been marked as a duplicate of bug 367553 ***
Comment 3 Herbert Wantesh 2013-01-17 09:34:55 UTC
you are right, but why should i discuss upstream? isn't this distro related? debian/ubuntu handles this case and shuts down all ssh connections when the pc reboots