Stopping And Restarting NetSaint


Once you have NetSaint up and running, you may need to stop the process or reload the configuration data "on the fly". This section describes how to do just that.

IMPORTANT: Before you restart NetSaint, make sure that you have verified the configuration data using the -v command line switch, especially if you have made any changes to your main or host config files. If NetSaint encounters problem with one of the config files when it restarts, it will log an error and stop.

Stopping And Restarting With The Init Script

If you have installed the sample init script to your /etc/rc.d/init.d directory you can stop and restart NetSaint easily. If you haven't, skip this section and read how to do it manually below. I'll assume that you named the init script netsaint in the examples below...

Desired Action Command Description
Stop NetSaint /etc/rc.d/init.d/netsaint stop This kills NetSaint and deletes the current status log
Restart NetSaint /etc/rc.d/init.d/netsaint restart This kills NetSaint, deletes the current status log, and then starts NetSaint up again
Reload Configuration Data /etc/rc.d/init.d/netsaint reload Sends a SIGHUP to the NetSaint process, causing it to flush its current configuration data, reread the configuration files, and start monitoring again

Stopping, restarting, and reloading NetSaint are fairly simple with an init script and I would highly recommend you use one if at all possible.

Manually Stopping and Restarting NetSaint

If you aren't using an init script to start NetSaint, you'll have to do things manually. First you'll have to find the process ID that NetSaint is running under and then you'll have to use the kill command to terminate the application or make it reload the configuration data by sending it the proper signal. Directions for doing this are outlined below...

Finding The Process ID

First off, you will need to know the process id that NetSaint is running as. To do that, just type the following command at a shell prompt:

ps axu | grep netsaint

The output should look something like this:

netsaint  6808  0.0  0.7   840   352  p3 S    13:44   0:00 grep netsaint
netsaint 11149  0.2  1.0   868   488  ?  S   Feb 27   6:33 ./netsaint netsaint.cfg
From the program output, you will notice that NetSaint was started by user netsaint and is running as process id 11149.

Stopping NetSaint

In order to stop NetSaint, use the kill command as follows...

kill 11149

You should replace 11149 with the actual process id that NetSaint is running as on your machine.

Restarting NetSaint

If you have modified the configuration data, you will want to 'restart' NetSaint and have it re-read the new configuration. If you have changed the source code and recompiled the main netsaint executable you should not use this method. Instead, stop NetSaint by killing it (as outlined above) and restart it manually. Restarting NetSaint using the method below does not actually reload NetSaint - it just causes NetSaint to flush its current configuration, re-read the new configuration, and start monitoring all over again. To restart NetSaint, you need to send the SIGHUP signal to NetSaint. Assuming that the process id for NetSaint is 11149 (taken from the example above), use the following command:

kill -HUP 11149

Remember, you will need to replace 11149 with the actual process id that NetSaint is running as on your machine.