Re: svn commit: r366857 - head/libexec/rc/rc.d

2020-12-03 Thread Ed Maste
On Wed, 2 Dec 2020 at 23:19, Cy Schubert  wrote:
>
> I've been looking at this earlier today, a different issue.
>
> This reverts r366857 and adds netifdown to run almost prior to shutdown.

The netbooted pine64 hwlab CI job has been mostly failing since the
original change as well as it appears the root filesystem disappears
before shutdown is complete:

```
root@pinea64-cidev:~ # poweroff
poweroff

Shutdown NOW!
poweroff: [pid 796]
root@pinea64-cidev:~ #

System shutdown Stopping devd.
Waiting for PIDS: 492.
nfs server 10.0.0.1:/b/tftpboot/pinea64/install/: not responding
```

https://ci.freebsd.org/hwlab/job/FreeBSD-device-head-pinea64-test/

Once the potential fix makes it into the tree I'll check on this again.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r366857 - head/libexec/rc/rc.d

2020-12-02 Thread Cy Schubert
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 ..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.



___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r366857 - head/libexec/rc/rc.d

2020-12-02 Thread John Baldwin
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?

-- 
John Baldwin
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r366857 - head/libexec/rc/rc.d

2020-10-19 Thread Cy Schubert
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

Modified:
  head/libexec/rc/rc.d/netif

Modified: head/libexec/rc/rc.d/netif
==
--- head/libexec/rc/rc.d/netif  Mon Oct 19 20:37:04 2020(r366856)
+++ head/libexec/rc/rc.d/netif  Mon Oct 19 20:37:38 2020(r366857)
@@ -28,7 +28,7 @@
 # PROVIDE: netif
 # REQUIRE: FILESYSTEMS iovctl serial sppp sysctl
 # REQUIRE: hostid ipfs
-# KEYWORD: nojailvnet
+# KEYWORD: nojailvnet shutdown
 
 . /etc/rc.subr
 . /etc/network.subr
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"