[OpenWrt-Devel] sysupgrade + reverse SSH tunnel broken

Bastian Bittorf bittorf at bluebottle.com
Thu Dec 17 04:17:34 EST 2015


when starting sysupgrade on a router with
an interactive reverse SSH session provided
via dropbear/dbclient, the "dbclient" gets
killed during early run of the script, keeping
the box unreachable. maybe this is the same
user other tunnels too.

there are 3 possible ways i can imagine:

1)
warn the user when such a tunnel is detected

2)
keep the tunnel-proider in a whitelist, so
they dont get killed during sysupgrade

3)
nohup the script more early (and keep the process
running when the connection is lost)

internally we are using this for such things:

#!/bin/sh
nohup()
{
	# close stdin, and make any read attempt an error
	[ -t 0 ] && exec 0>/dev/null

	# redirect stdout to a file if it's a TTY
	[ -t 1 ] && {
		exec 1>nohup.out || exec 1>nohup.out
	}

	# redirect stderr to stdout if it's a TTY
	[ -t 2 ] && exec 2>&1

	# trap the HUP signal to ignore it
	trap : HUP
}

# detach script from shell
nohup

...further commands



has somebody and idea what is the "best"?

bye, bastian
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list