init: replace reboots with calls to panic_action

This commit is contained in:
Calin Crisan 2018-09-16 23:19:20 +03:00
parent 1484de1aba
commit 4f47cacd83
6 changed files with 16 additions and 16 deletions

View File

@ -34,8 +34,8 @@ watch() {
while true; do
sleep 5
if ! running; then
logger -t hostapd -s "dead, rebooting"
reboot
logger -t hostapd -s "dead, calling panic action"
panic_action hostapd
break
fi
done

View File

@ -57,8 +57,8 @@ watch() {
count=$(($count + 5))
logger -t wifi -s "disconnected"
else
logger -t wifi -s "disconnected for $link_watch_timeout seconds, rebooting"
reboot
logger -t wifi -s "disconnected for $link_watch_timeout seconds, calling panic action"
panic_action wifi
fi
fi
done

View File

@ -41,8 +41,8 @@ watch() {
count=$(($count + 5))
logger -t ppp -s "disconnected"
else
logger -t ppp -s "disconnected for $link_watch_timeout seconds, rebooting"
reboot
logger -t ppp -s "disconnected for $link_watch_timeout seconds, calling panic action"
panic_action ppp
fi
fi
done

View File

@ -48,8 +48,8 @@ start() {
count=$(($count + 1))
if [ $count -ge 10 ]; then
msg_fail "no device"
logger -t bluetooth -s "bluetooth device not available, rebooting"
reboot
logger -t bluetooth -s "bluetooth device not available, calling panic action"
panic_action bluetooth
return 1
fi
done

View File

@ -34,8 +34,8 @@ watch_eth() {
count=$(($count + 5))
logger -t ethernet -s "disconnected"
else
logger -t ethernet -s "disconnected for $link_watch_timeout seconds, rebooting"
reboot
logger -t ethernet -s "disconnected for $link_watch_timeout seconds, calling panic action"
panic_action network
fi
fi
done
@ -53,8 +53,8 @@ watch_ip() {
count=$(($count + 5))
logger -t network -s "$iface has no IP address"
else
logger -t network -s "$iface had no IP address for $ip_watch_timeout seconds, rebooting"
reboot
logger -t network -s "$iface had no IP address for $ip_watch_timeout seconds, calling panic action"
panic_action network
fi
fi
done
@ -180,8 +180,8 @@ start() {
if [ "$eth_ok" != "ok" ] && [ "$wlan_ok" != "ok" ] && [ "$ppp_ok" != "ok" ]; then
if [ "$link_watch" == "true" ]; then
logger -t network -s "no network connection available, rebooting"
reboot
logger -t network -s "no network connection available, calling panic action"
panic_action network
return 1
else
logger -t network -s "no network connection available"

View File

@ -28,8 +28,8 @@ watch() {
count=$(($count + 1))
continue
else
logger -t netwatch -s "cannot connect to $netwatch_host:$netwatch_port, rebooting"
reboot
logger -t netwatch -s "cannot connect to $netwatch_host:$netwatch_port, calling panic action"
panic_action netwatch
fi
fi
done