Monitoring Service Status

Processes in deepOfix may be started or stopped. When you start a service, you will want to verify that the service is indeed running. Apart from this, you may find that some task that deepOfix performs normally is not happening. You will want to verify the process status in such a situation. You can use the status command with sv to check the status of a process:

root@host# sv status easypush
run: easypush: (pid 2539) 2659942s; run: log: (pid 2533) 2659942s

The output of this command has two parts,

1. the service related messages

2. the log related messages

The service related messages show the process id and the time this service has been running. The log related messages show the process id of the logging process and the time logging has been happening.

Using this command, we can check if the process is stopped, running or finished. The shortcut sv s performs the same function, and can be used instead.

Checking Service Logs

For every service directory in /var/service, there is a log subdirectory. The run file in this subdirectory issues the command to log the activities of the service. You can check the service logs, which are present in this directory.

Each service log folder contains a file called current. This file records the latest messages logged for the service. As this file grows, its contents may be backed into a file bearing the timestamp and it may be truncated. For qmail, the log directory is normally /var/log/qmail. You can check the latest logs by using:

user@host:~# less /var/log/qmail/current

This command will show lines indicating what happens to mails queued up for delivery. This way, users can see what is happening to their emails. Logs are an excellent way of checking what is happening on the deepOfix server.

A list of log file paths can be found by typing:

user@host# cat /var/easypush/etc/logfile.list
 
help/command-line/monitoring-services.txt · Last modified: 2009/07/24 02:25 by gaurav     Back to top