Process Monitoring

 < Free Open Study > 



If mail isn't flowing—messages aren't coming in or going out—the first thing to do is verify that the long-lived qmail processes are running. A properly functioning qmail installation should always have the following four processes:

  • qmail-send running as user qmails

  • qmail-clean running as user qmailq

  • qmail-rspawn running as user qmailr

  • qmail-lspawn running as user root

Depending on your variation of Unix, one of the following two commands should list these processes, and possibly a few more:

 ps -ef | grep qmail ps waux | grep qmail 

For example:

 # ps waux|grep qmail root      847  0.1  1336  348 ?        S    06:19    0:00 supervise qmail-send root      849  0.1  1336  348 ?        S    06:19    0:00 supervise qmail-smtpd qmaild    854  0.2  1408  512 ?        S    06:19    0:00 /usr/local/bin/tcpserve r -v -p -x /etc/tcp.smtp.cdb -c 20 -u 502 -g 5 qmails    859  0.1  1392  408 ?        S    06:19    0:00 qmail-send qmaill    861  0.1  1348  348 ?        S    06:19    0:00 /usr/local/bin/multilog  t /var/log/qmail qmaill    863  0.1  1348  348 ?        S    06:19    0:00 /usr/local/bin/multilog  t /var/log/qmail/smtpd root      865  0.1  1348  360 ?        S    06:19    0:00 qmail-lspawn ./Maildir/ qmailr    866  0.1  1348  360 ?        S    06:19    0:00 qmail-rspawn qmailq    867  0.1  1340  368 ?        S    06:19    0:00 qmail-clean root      962  0.2  1620  592 pts/0    R    08:06    0:00 grep qmail # 

If you run qmail-send or qmail-smtpd under supervise, as in the previous example, you should see those processes as well. And if you run qmail-smtpd under tcpserver, you should see a parent tcpserver process plus an additional tcpserver process for each active incoming Simple Mail Transfer Protocol (SMTP) session.

If you use multilog (or splogger or cyclog) to handle logging, you'll have one or two of those processes running as user qmaill.

Also, if qmail is busy delivering messages locally or remotely, you'll see up to concurrencylocal qmail-local processes and up to concurrencyremote qmail-remote processes.

If all of the qmail-related processes look normal, the next step is to check the logs.

If some of the processes that should be running aren't, you'll have to determine why they're not running. If you've just installed or reconfigured qmail, chances are good that you've made an error. Go back over your work and double-check it for typographical errors and omitted steps.

After you've double-checked the configuration, make sure the services that start the processes are up and active. With the qmailctl script, the stat function does this:

 # qmailctl stat /service/qmail-send: up (pid 855) 2251 seconds /service/qmail-send/log: up (pid 861) 2251 seconds /service/qmail-smtpd: up (pid 856) 2251 seconds /service/qmail-smtpd/log: up (pid 864) 2251 seconds messages in queue: 0 messages in queue but not yet preprocessed: 0 # 

Pay particular attention to the up times. Normally they'll all be within a couple of seconds of each other, and they should be about as long as it has been since the system was booted or qmail was started or restarted. If one or more of them consistently show only a few seconds of up time, supervise is having trouble keeping the service running. Again, this is usually due to typographical errors in run scripts or commands, or commands skipped completely. It can also be due to system-resource limitations such as insufficient memory. Double-check your work and check the system logs and console for error messages.



 < Free Open Study > 



The Qmail Handbook
The qmail Handbook
ISBN: 1893115402
EAN: 2147483647
Year: 2001
Pages: 186
Authors: Dave Sill

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net