Why SIGHUP?

Earlier this week I sent a SIGHUP signal to a process to get it to reread it’s configuration file. Of all the signals that could have been chosen to perform this action, why SIGHUP? Well — the answer to this question comes on page 267 of Advanced Programming in the UNIX Environment 1st edition:

“This signal [SIGHUP] is commonly used to notify daemon processes (Chapter 13) to reread their configuration files. The reason SIGHUP is chosen for this is because a daemon should not have a controlling terminal and would normally never receive this signal.”

Richard Stevens is my favorite technical writer of all time. He uses tons of well though out examples, and tackles subjects in a logical order (this is my biggest beef with some books). I miss him.

Leave a Reply

Your email address will not be published. Required fields are marked *