diff mbox series

[OpenWrt-Devel] base-files: sysupgrade: Bring down wifi just before killall

Message ID 20190615221019.20460-1-lede@allycomm.com
State Changes Requested
Delegated to: John Crispin
Headers show
Series [OpenWrt-Devel] base-files: sysupgrade: Bring down wifi just before killall | expand

Commit Message

Jeff Kletsky June 15, 2019, 10:10 p.m. UTC
From: Jeff Kletsky <git-commits@allycomm.com>

Wifi can, in certain situations, cause sysupgrade to fail silently
with a 256 return value as all processes can't be killed.
One of these situations is mesh with batman-adv active.

Added `wifi down` just prior to the killall sequence in stage2

Run-tested-on: Linksys EA8300

Signed-off-by: Jeff Kletsky <git-commits@allycomm.com>
---
 package/base-files/files/lib/upgrade/stage2 | 4 ++++
 1 file changed, 4 insertions(+)

Comments

John Crispin July 1, 2019, 2:12 p.m. UTC | #1
On 16/06/2019 00:10, Jeff Kletsky wrote:
> From: Jeff Kletsky <git-commits@allycomm.com>
>
> Wifi can, in certain situations, cause sysupgrade to fail silently
> with a 256 return value as all processes can't be killed.
> One of these situations is mesh with batman-adv active.
>
> Added `wifi down` just prior to the killall sequence in stage2
>
> Run-tested-on: Linksys EA8300
>
> Signed-off-by: Jeff Kletsky <git-commits@allycomm.com>
> ---
>   package/base-files/files/lib/upgrade/stage2 | 4 ++++
>   1 file changed, 4 insertions(+)
>
> diff --git a/package/base-files/files/lib/upgrade/stage2 b/package/base-files/files/lib/upgrade/stage2
> index bdc12c7426..d911614e36 100755
> --- a/package/base-files/files/lib/upgrade/stage2
> +++ b/package/base-files/files/lib/upgrade/stage2
> @@ -124,6 +124,10 @@ kill_remaining() { # [ <signal> [ <loop> ] ]
>   
>   indicate_upgrade
>   
> +if [ -x "$(which wifi)" ] ; then
> +    wifi down
> +    sleep 1

the sleep 1 is really not good. could you try to figure out what 
actually causes the 256 and try to fix that instead please ?

     John


> +fi
>   killall -9 telnetd
>   killall -9 dropbear
>   killall -9 ash
diff mbox series

Patch

diff --git a/package/base-files/files/lib/upgrade/stage2 b/package/base-files/files/lib/upgrade/stage2
index bdc12c7426..d911614e36 100755
--- a/package/base-files/files/lib/upgrade/stage2
+++ b/package/base-files/files/lib/upgrade/stage2
@@ -124,6 +124,10 @@  kill_remaining() { # [ <signal> [ <loop> ] ]
 
 indicate_upgrade
 
+if [ -x "$(which wifi)" ] ; then
+    wifi down
+    sleep 1
+fi
 killall -9 telnetd
 killall -9 dropbear
 killall -9 ash