Name
SIGHUP
Synopsis
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 -bd
, -bd). For example, consider initially running
sendmail like this:
# /usr/sbin/sendmail -bd -q1h
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:
# kill -HUP `head -1 /etc/mail/sendmail.pid`
This will cause sendmail to execute the command:
/usr/sbin/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.
Get Sendmail, 3rd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.