How to auto restart network service [message #27095] |
Sat, 09 February 2008 04:47 |
ricoche
Messages: 17 Registered: January 2008 Location: Nagano Japan
|
Junior Member |
|
|
Hi there,
Does anyone know how to configure the HN Node to run "service network restart" when it fails? I am having a network failure once a day and until I find the problem I need a way to auto restart when the network stops.
Thanks,
Jim
[Updated on: Sat, 09 February 2008 04:50] Report message to a moderator
|
|
|
Re: How to auto restart network service [message #27098 is a reply to message #27095] |
Sat, 09 February 2008 08:24 |
|
shuaib85
Messages: 59 Registered: September 2007
|
Member |
|
|
You might need to write a shell script that keeps checking the status. and once it fails it will restart.
I am not on my machine now so the script might look like this
status= `service network status`
if status == " network is stopped" #check the output
do
service network start
done
run it in infinite loop
I wish this help
WebVZ: OpenVZ Web Management Tool
http://webvz.sourceforge.net
|
|
|