From: Thomas Veerman Date: Thu, 13 Sep 2012 11:51:36 +0000 (+0000) Subject: INET: fix crash recovery script X-Git-Tag: v3.2.1~333 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/man.rndc-confgen.html?a=commitdiff_plain;h=8152b3ac4ce859cca5990e4db91445fd60892024;p=minix.git INET: fix crash recovery script --- diff --git a/etc/rs.inet b/etc/rs.inet index 6d310034a..57c458827 100755 --- a/etc/rs.inet +++ b/etc/rs.inet @@ -1,7 +1,7 @@ #!/bin/sh -# 'Recovery' script that doesn't. This script is to be used for drivers that -# should not be restarted. Instead, the scripts configures the driver 'down'. +# Recovery script for INET/lwip. It restarts daemons dependent on it in order +# to recover TCP state. kill_by_name() { @@ -60,15 +60,26 @@ service down "$1" kill_by_name dhcpd kill_by_name nonamed kill_by_name syslogd + +# Wait a moment to let daemons clean themselves up sleep 3 if [ X`/bin/sysenv lwip` = Xyes ] then - service up /usr/sbin/lwip -script /etc/rs.inet + service up /usr/sbin/lwip -script /etc/rs.inet -dev /dev/ip -devstyle STYLE_CLONE_A dhcpd --lwip & else - service up /usr/sbin/inet -script /etc/rs.inet + service up /usr/sbin/inet -script /etc/rs.inet -dev /dev/ip -devstyle STYLE_CLONE daemonize dhcpd fi daemonize nonamed -L daemonize syslogd +# Restart SSH daemon if installed and running +if [ -f /usr/pkg/etc/rc.d/sshd ] +then + /usr/pkg/etc/rc.d/sshd status | grep -v not > /dev/null + if [ $? -eq 0 ] + then + /usr/pkg/etc/rc.d/sshd restart + fi +fi