Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1359713 > unrolled thread
| Started by | Han Pingtian <hanpt@linux.vnet.ibm.com> |
|---|---|
| First post | 2016-03-17 11:30 +0100 |
| Last post | 2016-03-17 11:30 +0100 |
| Articles | 1 — 1 participant |
Back to article view | Back to linux.kernel
cgroup pids controller kills systemd service? Han Pingtian <hanpt@linux.vnet.ibm.com> - 2016-03-17 11:30 +0100
| From | Han Pingtian <hanpt@linux.vnet.ibm.com> |
|---|---|
| Date | 2016-03-17 11:30 +0100 |
| Subject | cgroup pids controller kills systemd service? |
| Message-ID | <rdDlM-68F-19@gated-at.bofh.it> |
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@pinelp3 ~ %
● 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.
Back to top | Article view | linux.kernel
csiph-web