[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20160317102616.GA2986@localhost.localdomain>
Date: Thu, 17 Mar 2016 18:26:16 +0800
From: Han Pingtian <hanpt@...ux.vnet.ibm.com>
To: linux-kernel@...r.kernel.org
Subject: cgroup pids controller kills systemd service?
Hi,
I noticed that if a systemd service forks children fiercely, then the whole
service will be terminated, perhaps by the kernel. Is this designed?
I have this reproducer:
$ cat reproducer/reproducer.service
[Unit]
Description=Reproducer of bz 136929
After=multi-user.target
[Service]
ExecStart=/home/hpt/reproducer/reproducer.sh
Type=forking
[Install]
WantedBy=multi-user.target
% cat reproducer/reproducer.sh
#!/bin/bash
foo()
{
echo $1: $(date)
sleep 30
}
bar()
{
c=1
while true
do
for ((i=1;i<=2048;i++))
do
foo $c &
((c++))
done
wait
c=1
done
}
# main
bar &
disown -a
exit 0
The default task limit of systemd is 512. Soon after the starting of the
service, it failed with those messages:
% sudo systemctl status reproducer.service 4:02 hpt@...elp3 ~ %
● reproducer.service - Reproducer of bz 136929
Loaded: loaded (/etc/systemd/system/reproducer.service; disabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Thu 2016-03-17 04:02:09 CDT; 13s ago
Process: 14859 ExecStart=/home/hpt/reproducer/reproducer.sh (code=exited, status=0/SUCCESS)
Main PID: 14861 (code=exited, status=254)
Mar 17 04:02:07 pinelp3 reproducer.sh[14859]: /home/hpt/reproducer/reproducer.sh: fork: Resource temporarily unavailable
Mar 17 04:02:07 pinelp3 reproducer.sh[14859]: /home/hpt/reproducer/reproducer.sh: fork: Resource temporarily unavailable
Mar 17 04:02:07 pinelp3 reproducer.sh[14859]: /home/hpt/reproducer/reproducer.sh: fork: Resource temporarily unavailable
Mar 17 04:02:08 pinelp3 reproducer.sh[14859]: /home/hpt/reproducer/reproducer.sh: fork: Resource temporarily unavailable
Mar 17 04:02:08 pinelp3 reproducer.sh[14859]: /home/hpt/reproducer/reproducer.sh: fork: Resource temporarily unavailable
Mar 17 04:02:08 pinelp3 reproducer.sh[14859]: /home/hpt/reproducer/reproducer.sh: fork: Resource temporarily unavailable
Mar 17 04:02:08 pinelp3 systemd[1]: reproducer.service: Main process exited, code=exited, status=254/n/a
Mar 17 04:02:09 pinelp3 systemd[1]: reproducer.service: Unit entered failed state.
Mar 17 04:02:09 pinelp3 systemd[1]: reproducer.service: Failed with result 'exit-code'.
Mar 17 04:02:18 pinelp3 systemd[1]: Stopped Reproducer of bz 136929
Thanks in advance.
Powered by blists - more mailing lists