From owner-svn-src-head@freebsd.org Thu Dec 3 04:18:57 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0525547934B; Thu, 3 Dec 2020 04:18:57 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CmjJc36WZz4l0N; Thu, 3 Dec 2020 04:18:56 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.229.168]) by shaw.ca with ESMTPA id kg4ykUDwD34axkg50khQXb; Wed, 02 Dec 2020 21:18:54 -0700 X-Authority-Analysis: v=2.4 cv=LvQsdlRc c=1 sm=1 tr=0 ts=5fc8672e a=7AlCcx2GqMg+lh9P3BclKA==:117 a=7AlCcx2GqMg+lh9P3BclKA==:17 a=xqWC_Br6kY4A:10 a=kj9zAlcOel0A:10 a=zTNgK-yGK50A:10 a=6I5d2MoRAAAA:8 a=zfY9hoTtAAAA:8 a=FtSH8AnkAAAA:8 a=YxBL1-UpAAAA:8 a=EkcXrb_YAAAA:8 a=ZQhl43eJsd_oFGX8ndEA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=5hhNq975vnbPBhNyUpu_:22 a=Bk7rEp8Xs0BjyB-fwPJV:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [IPv6:fc00:1:1:1::5b]) by spqr.komquats.com (Postfix) with ESMTPS id 922E44C0; Wed, 2 Dec 2020 20:18:51 -0800 (PST) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.16.1/8.16.1) with ESMTP id 0B34Ip8X002739; Wed, 2 Dec 2020 20:18:51 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <202012030418.0B34Ip8X002739@slippy.cwsent.com> X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: John Baldwin cc: Cy Schubert , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r366857 - head/libexec/rc/rc.d In-reply-to: References: <202010192037.09JKbcAY079308@repo.freebsd.org> Comments: In-reply-to John Baldwin message dated "Wed, 02 Dec 2020 17:12:33 -0800." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 02 Dec 2020 20:18:51 -0800 X-CMAE-Envelope: MS4xfPrKtQmJJeRdrvWt9fdSx9M98a8wKzEKwBuRd2gRDUvNYlHmR7x7bbgEAK9XFoXa5BEUYN717eIDKJt00sC1W2KzMdvibvbPwbyrU1sQ9cdKnWyzYa4q Jt6LDLGFL5kn4urQrucp1jBhQ4zjK8QDORpuZQDKpz6k76LfqGm8V3TN85Q41mpQjHaIaSKmvQyEM/Ya9kJJ8IX0H0R4SPHGZccjIjDxRSgXC3jtaxvJna9f XB1U1hDYvYpnAc2x9kBKNC5HhM5iI7RKjqHedBkN85LVcrXzRkFXDzZIbl04kDp5H6ZsXSdcg5sX6Zbd2HnMEiTVp3y/RyrSuZxpv996AO8= X-Rspamd-Queue-Id: 4CmjJc36WZz4l0N X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Dec 2020 04:18:57 -0000 In message , John Baldwin wri tes: > On 10/19/20 1:37 PM, Cy Schubert wrote: > > Author: cy > > Date: Mon Oct 19 20:37:38 2020 > > New Revision: 366857 > > URL: https://svnweb.freebsd.org/changeset/base/366857 > > > > Log: > > Destroy cloned interfaces at netif stop, netif restart and shutdown. > > This is especially important during shutdown because a child interface > > of lagg with WOL enabled will not enable WOL at interface shutdown and > > thus no WOL to wake up the device (and machine). > > > > PR: 158734, 109980 > > Reported by: Antonio Huete Jimenez > > Marat N.Afanasyev > > reviewed by: kp > > MFC after: 1 week > > Differential Revision: https://reviews.freebsd.org/D26797 > > This causes some rather weird breakage for me. Namely, after this > change, if I'm logged into a host via ssh and reboot it (via > shutdown -r now), I no longer get gracefully logged out by the > shutdown process as the network connections are all killed before > users are kicked off the system. Instead, my ssh connection hangs > around forever until either it times out due to keep alives, or the > host in question reboots and send back a RST. > > As I rather frequently use shutdown -r now or poweroff remotely via > ssh, I've found this rather annoying as I have to use ~. to recover > my shell again (and woe to me if it was a nested login and I forgot > to add enough extra ~'s to escape the N levels). > > Probably if you only destroyed cloned interfaces during shutdown and > not all interfaces that would be a happy-enough compromise that > would still satisfy the original PR? I've been looking at this earlier today, a different issue. This reverts r366857 and adds netifdown to run almost prior to shutdown. diff --git a/libexec/rc/rc.d/netif b/libexec/rc/rc.d/netif index b4b8ccb1aede..eb1efc4d6274 100755 --- a/libexec/rc/rc.d/netif +++ b/libexec/rc/rc.d/netif @@ -28,7 +28,7 @@ # PROVIDE: netif # REQUIRE: FILESYSTEMS iovctl serial sppp sysctl # REQUIRE: hostid ipfs -# KEYWORD: nojailvnet shutdown +# KEYWORD: nojailvnet . /etc/rc.subr . /etc/network.subr diff --git a/libexec/rc/rc.d/netifdown b/libexec/rc/rc.d/netifdown new file mode 100755 index 000000000000..8d64a1db06a2 --- /dev/null +++ b/libexec/rc/rc.d/netifdown @@ -0,0 +1,34 @@ +#!/bin/sh +# +# Copyright (c) 2003 The FreeBSD Project. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE PROJECT ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE PROJECT BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +# $FreeBSD$ +# + +# PROVIDE: netifdown +# REQUIRE: netwait +# KEYWORD: nojailvnet shutdown nostart + +. /etc/rc.subr +. /etc/network.subr +. /etc/rc.d/netif I tested it here. It works better than my original solution. -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org The need of the many outweighs the greed of the few.