2

The systemd.kill docs have the following to say about KillMode:

KillMode=

Specifies how processes of this unit shall be killed. One of control-group, mixed, process, none.

If set to control-group, all remaining processes in the control group of this unit will be killed on unit stop (for services: after the stop command is executed, as configured with ExecStop=). If set to mixed, the SIGTERM signal (see below) is sent to the main process while the subsequent SIGKILL signal (see below) is sent to all remaining processes of the unit's control group. If set to process, only the main process itself is killed (not recommended!). If set to none, no process is killed (strongly recommended against!). In this case, only the stop command will be executed on unit stop, but no process will be killed otherwise. Processes remaining alive after stop are left in their control group and the control group continues to exist after stop unless empty.

Note that it is not recommended to set KillMode= to process or even none, as this allows processes to escape the service manager's lifecycle and resource management, and to remain running even while their service is considered stopped and is assumed to not consume any resources.

And indeed KillMode=none has been deprecated, though the PR deprecating them isn't much more informative.

What exactly is the problem with KillMode=process or none? That these processes might live until they die a natural death, or the system shuts down? But so what?

For context, I'm looking at patterns such as described in this blog post for zero-downtime deployments of HTTP servers. In my case, there are worked threads that can be running for up to an hour, and killing them would mean starting their work from scratch.

0

You must log in to answer this question.

Browse other questions tagged .