CodePark/ questions / Signals & process lifecycle
START PRACTICINGPRACTICE
Backend question · OS, networking & Linux › Signals & process lifecycle

What does kill -HUP <pid> do when sent to the nginx master process?

It reloads the configuration, starting new workers while old workers finish their current requests

It reloads the configuration without dropping requests. By default SIGHUP ends a process. But nginx, like many daemons (background services), installs its own handler and treats SIGHUP as a reload:
• It reads the config file again.

• It starts new worker processes.

• It lets the old workers finish their current requests, then stops them.


"Nothing, because SIGHUP only affects processes attached to a terminal" is wrong. You can send SIGHUP to any process, whether it has a terminal or not.