[systemd-devel] service killed by cgroup controller pids?
Han Pingtian
hanpt at linux.vnet.ibm.com
Wed Apr 6 02:49:15 UTC 2016
On Fri, Apr 01, 2016 at 09:32:16PM +0200, Lennart Poettering wrote:
> 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...
>
Thanks for your reply. This problem looks like a bug of bash. It is the
bash quits with error code when it failing to fork process with EAGAIN.
More information about the systemd-devel
mailing list