26.3 Signaling the DaemonThe sendmail program recognizes three signals that cause it to perform certain actions. SIGINT causes sendmail to clean up after itself and exit. Beginning with V8.7, SIGHUP causes sendmail to re-execute itself (thus restarting and reading its configuration file anew). Also beginning with V8.7, SIGUSR1 causes sendmail to log its file descriptors and other information. 26.3.1 SIGINT Cleanup and ExitWhenever sendmail gets a SIGINT signal (as would be the case if the system were being shut down), it tries to exit cleanly. First it unlocks any queued file it is processing. This has the effect of canceling delivery so that the message will be tried again when the system comes back up. Then sendmail resets its identity to the identity it originally ran under. This causes accounting records to correctly show that the same user sendmail started as has exited. Finally, sendmail exits with EX_OK, no matter what, so that errors will not be produced during shutdown.
As a final note, beginning with V8.7,
SIGINT is ignored when
sendmail
is running
in rule-testing mode with 26.3.2 SIGHUP Restart
Beginning with V8.7, a SIGHUP signal will
cause
sendmail
to re-execute itself with its original
command line. This works only if it is running in daemon mode
(with
# Then imagine that you changed something in the configuration file and wanted the running daemon to reread that file. You could cause that to happen by killing the currently running daemon with a SIGHUP signal:
# This will cause sendmail to execute the command
/usr/lib/sendmail -bd -q1h The original daemon exits, and the newly executed daemon replaces it. Be aware that this works only if you run sendmail using a full pathname. If you use a relative path, an attempt to restart sendmail with SIGHUP will fail, and the following warning will be logged at LOG_ALERT:
could not exec bad command line here : reason This is a very serious situation because it means that your original daemon has exited and no new daemon ran to replace it. 26.3.3 SIGUSR1 Dump StatesBeginning with V8.6.5, sendmail responds to a SIGUSR1 signal. This signal causes sendmail to syslog at LOG_DEBUG the several items that define its state. [2] That syslog output begins with a line that looks like this:
-- dumping state on
where
Whichever the reason, the information that is logged for each looks pretty much the same; for example,
-- dumping state on
We have described the first line already. If for some reason
*** $j not in $=w ***
The second line simply shows the number
of children the daemon has forked and currently has out doing
other work in parallel with itself. That line is followed by three
sections of information. The first two sections are always output;
the third is output only if rule set 26.3.3.1 -- open file descriptors: --Each open file descriptor is displayed along with its current properties. These lines of output can be numerous. In general form, they look like this:
Here, the 26.3.3.2 -- connection cache: --When sending mail, outgoing connections are maintained for efficiency, and information about those connections is cached. Before connecting to a remote host, for example, sendmail checks its cache to see whether that host is down. If it is, it skips connecting to that host.
This output is highly detailed and very complicated. See the
26.3.3.3 -- ruleset debug_dumpstate returns stat ..., pv: --
If rule set
Rule set
Sdebug_dumpstate R$* $@ $&_ $&s $&i
Here, the Another example might involve the need to look up the current recipient's host with DNS:
Sdebug_dumpstate R$* $@ $[ $&h $]
The
In general, rule set
Do not be tempted to use rule set |
|