From: Michael Tremer <michael.tremer@ipfire.org>
To: Peer Dietzmann <dietzmann@brecht-schule.hamburg>
Cc: development@lists.ipfire.org
Subject: Re: sshd kill all sessions on deamon stop
Date: Sun, 24 Aug 2025 13:55:14 +0100 [thread overview]
Message-ID: <BF5FDE85-736D-40F9-9597-AFAA65617D70@ipfire.org> (raw)
In-Reply-To: <6d9b9a50-4479-422f-a370-540a59fa6959@brecht-schule.hamburg>
Hello Peer,
Thank you for your email.
I understand what you want to achieve here, but I don’t quite unterstand why. Why would those sessions need to be closed?
Your patch would have some other consequences which I don’t think you intend. For example, if someone would install an update using a SSH console and if that update upgrades OpenSSH and restarts it abort the update. The process would terminate the updater and you would be left with an incomplete update.
I suppose what we could think about is to move terminating the SSH daemon before the network is being shut down. Would that fix your problem?
-Michael
> On 24 Aug 2025, at 07:25, Peer Dietzmann <dietzmann@brecht-schule.hamburg> wrote:
>
> Hi All,
>
> I discovered, that while rebooting an IPFire instance via SSH my terminal keeps stuck after the broadcast message because IPFire isn't closing all active connection correctly. As it is annoying especially when using SSH in SSH connections because all connections have to be reopened manually, I thought of adding just one line to the init-script that closes all running sessions.
>
> Best regards,
>
> Peer
>
>
> diff --git a/src/initscripts/system/sshd b/src/initscripts/system/sshd
> index e5a9931af..e69904c61 100644
> --- a/src/initscripts/system/sshd
> +++ b/src/initscripts/system/sshd
> @@ -50,6 +50,7 @@ case "$1" in
> stop)
> boot_mesg "Stopping SSH Server..."
> killproc -p "/var/run/sshd.pid" /usr/sbin/sshd || true
> + killall sshd-session
> ;;
>
> reload)
>
>
next prev parent reply other threads:[~2025-08-24 12:55 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-24 6:25 Peer Dietzmann
2025-08-24 12:55 ` Michael Tremer [this message]
2025-08-24 17:59 ` Peer Dietzmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=BF5FDE85-736D-40F9-9597-AFAA65617D70@ipfire.org \
--to=michael.tremer@ipfire.org \
--cc=development@lists.ipfire.org \
--cc=dietzmann@brecht-schule.hamburg \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox