DWatch Utility

When DSMTP, DPOP and DList are installed, a small but very important utility, DWatch, is normally also installed. It starts up the three servers at boot time and then periodically checks that they are still running. If for some reason they have died abnormally, DWatch will restart them, and optionally archive their log file for later analysis (a 'ded' file).

NB1: On Windows NT, dwatch is run as a service and, in turn, it starts DPOP, DSMTP and DList. So to stop the servers when DMAdmin is not working you should stop the dwatch service from NT's Control Panel, Services window (see also exit_files below).

NB2: On Windows NT, if one of the servers dies then by default a system alert window will pop up. When this happens, dwatch cannot detect that the program has died until you manually close the alert window. So to allow dwatch to restart the server when it dies you should go to the 'DWatch + remote' tab in DMAdmin, click on the 'Config DWatch' button, and then click on the button marked 'Don't pop up dialogue when any program dies' under ANY one of the servers being monitored ( you can also set the debugger to DrWatson).

The use of DWatch is controlled by the use of a DWatch directory, set by the config setting dwatch_path. DWatch looks for files in this directory called xxxx.wat containing information on how to restart xxx, how often to check that it is running and how many times to restart it.

The xxx.wat files are normally created by the DMSetup wizard. From then on they are easily modified in DMAdmin, or directly in a text editor, e.g. notepad or vi.

Here is an example .wat file for DList:

exec C:\dmail\dlist\dlist.exe # specifies full path to executable file
time 20 # delay between 'still operating' check, in seconds
rest 5 # number of times to retry starting program
logfile C:\dmail\log\dlist.log # full path to log file for the program being watched
pidf C:\dmail\dwatch\dlist.pid # name of pid file (with full path) to check

The servers themselves write xxx.pid files (process id files) to the DWatch directory when they are started and remove them on normal shutdown.

The default dwatch_path setting is dpop_path,, however on Windows NT the DMSetup installation wizard creates a specific 'dwatch' directory as default and points dwatch_path at it.

Example dwatch_path setting in dmail.conf:

UNIX based platforms:
dwatch_path /usr/local/dmail/dwatch

Windows platforms:
dwatch_path \dmail\dwatch

DWatch also creates a temporary log file and stores it at the path given by the log_path setting (the same as work_path by default). This log file contains only DWatch information and is overwritten at the start of each DWatch session, i.e. on restart or at the start of the following day.

Ded Files

When one of the servers dies, DWatch should notice and restart the server (see the note NB2 above). When it does this, by default it will RENAME the current log file for that server, e.g. dpop.log, to a 'ded' file, e.g. d_1dpop.ded. These ded files are named as, d_xserver.ded, where x is incremented on each death (so 1 is the first death dwatch caught), and 'server' is the name of the server, i.e. DPOP, DSMTP or DList.

Ded files are created in the dwatch_path directory.

Exit Files

A useful trick to know is that you can stop most of the servers by putting a file in this directory named, server.exit, e.g. if DList sees a file called dlist.exit in the dwatch directory, then it will shut itself down (and remove the exit file when it does so).

(For even greater Internet System monitoring capability have a look at another excellent NetWin product, Internet WatchDog, see the products page)