Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 Sep 2023 09:50:13 GMT
From:      Ed Maste <emaste@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 8ee97b1928e7 - main - freebsd-update: do not restart sshd when updating jail/basedir
Message-ID:  <202309180950.38I9oDec036502@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by emaste:

URL: https://cgit.FreeBSD.org/src/commit/?id=8ee97b1928e75f7f81a870ffb063010778e0a129

commit 8ee97b1928e75f7f81a870ffb063010778e0a129
Author:     Ed Maste <emaste@FreeBSD.org>
AuthorDate: 2023-09-16 20:46:16 +0000
Commit:     Ed Maste <emaste@FreeBSD.org>
CommitDate: 2023-09-18 09:47:01 +0000

    freebsd-update: do not restart sshd when updating jail/basedir
    
    In 6cd1bc531609 for PR 263489 I changed freebsd-update to restart sshd
    after upgrade, to avoid an upgrade-related incompatibility that made it
    impossible to login.
    
    This is intended to avoid losing access to remote hosts, and ought not
    apply to upgrading jails (from outside).
    
    PR:             263489, 272282
    Reported by:    otis
    Reviewed by:    otis, kevans
    MFC after:      3 days
    Sponsored by:   The FreeBSD Foundation
    Fixes: 6cd1bc531609 ("freebsd-update: restart sshd after upgrade")
    Differential Revision: https://reviews.freebsd.org/D41890
---
 usr.sbin/freebsd-update/freebsd-update.sh | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/usr.sbin/freebsd-update/freebsd-update.sh b/usr.sbin/freebsd-update/freebsd-update.sh
index 57023557839b..9cdff05c24e4 100644
--- a/usr.sbin/freebsd-update/freebsd-update.sh
+++ b/usr.sbin/freebsd-update/freebsd-update.sh
@@ -3036,9 +3036,10 @@ Kernel updates have been installed.  Please reboot and run
 		install_from_index INDEX-NEW || return 1
 		install_delete INDEX-OLD INDEX-NEW || return 1
 
-		# Restart sshd if running (PR263489).  Note that this does not
-		# affect child sshd processes handling existing sessions.
-		if service sshd status >/dev/null 2>/dev/null; then
+		# Restart host sshd if running (PR263489).  Note that this does
+		# not affect child sshd processes handling existing sessions.
+		if [ "$BASEDIR" = / ] && \
+		    service sshd status >/dev/null 2>/dev/null; then
 			echo
 			echo "Restarting sshd after upgrade"
 			service sshd restart



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202309180950.38I9oDec036502>