[systemd-devel] service killed by cgroup controller pids?

Lennart Poettering lennart at poettering.net
Fri Apr 1 19:32:16 UTC 2016


On Mon, 21.03.16 11:02, Han Pingtian (hanpt at linux.vnet.ibm.com) wrote:

> % cat /etc/systemd/system/reproducer.service 
> [Unit]
> Description=Reproducer of systemd services killed by pids
> After=multi-user.target
> 
> [Service]
> ExecStart=/home/hpt/reproducer/reproducer.sh
> Type=forking

> The default TasksMax is 512. Is this a problem of kernel? I think child 
> processes cannot be forked shouldn't cause parent to die. Is that right?

So, you use Type=forking without specifiying a PIDFile=. In that case
systemd has to guess the main process of the service, but that's black
magic, since you fork agressively and thus there are many processes
around and it's not clear which one is the main process...

The unit file is hence simply incorrectly written. Type=forking should
only be used if it's clear that there's only one main process around,
or you set PIDFile= to tell systemd which the main process of your
service is...

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list