Server Watchdog

This is a followup to this post. It seems there’s a more graceful option to reboot the server when there are problems.

These instructions are for debian

1. Add the following lines to /etc/sysctl.conf

2. server:~# apt-get install watchdog

3. In /etc/watchdog.conf, uncomment the following:

[ You may want to play with some of the other settings, most
notibly ping. I didnt have luck with it, however. My server
constantly rebooted ]

4. server:~# /sbin/modprobe softdog

5. add the following to /etc/modules

6. Reboot

Bash Restart on Network Failure

[UPDATED INFORMATION]

Here’s a bash script I’m using on my server to restart the server in the event network goes down.  I set this up because, during a large file transfer through Samba, the server’s network stopped responding.  To be on the safe side, I’m doing a full restart.

The scripts attempt to ping HOST (192.168.1.1, my router), MAX_FAILURES (3) times.  After the 3rd failure, the server will restart.  If the network comes back before the restart, we’ll proceed as if nothing happened.  I’m waiting 5 minutes between each attempt.

I’m running this through an hourly cronjob.

AT&T DSL Setup Behind a Linksys Router running Tomato

I’m doing this mainly for myself so I can replicate what I did in the future.  It’s pretty straight forward but a simple misconfiguration made it so the internet couldn’t see my server.

About my network:

  • Prior to moving to DSL, I had a cable modem that passed it’s IP address along to my Router.
  • My internal network was in the 192.168.1.x address range.
  • I had a combination of static and dynamic addresses.  My servers were all static and I had certain ports accessible from the outside.

DSL Setup

  1. For the initial setup, I connected my computer directly to the modem and went through their automatic setup mess.
  2. Log into the modem (192.168.1.254), and set it so PPPoE authentication is not done at the modem. – Doing this will make you lose access to the modem configuration page.
  3. Set the Router to do PPPoE authentication using the AT&T username and password.