-
Notifications
You must be signed in to change notification settings - Fork 474
Description
Description
Trying to create more than ~400 processes / threads fails
To Reproduce
distrobox create --name test --init --image quay.io/archlinux/archlinux:latest --additional-packages "systemd"
distrobox enter test
for i in {1..400} ; do ( sleep 1 & ); done
Error:
bash: fork: retry: Resource temporarily unavailable
Expected behavior
Bash does not fail to create more than ~400 processes
Logs
distrobox-test.log
podman-logs.log
Desktop:
Using podman version 4.9.0
Using distrobox version 1.6.0.1
On: NixOS 24.05 (Uakari) & unstable packages
Distrobox was installed with the installation scripts into ~/.local
Additional context
I'm not entirely sure if it is resource limits, but it seems to have something to do with the distrobox enter command putting your shell in init.scope
[siryellsalot@test ~]$ systemctl status
● test.gengar
State: running
Units: 554 loaded (incl. loaded aliases)
Jobs: 0 queued
Failed: 0 units
Since: Thu 2024-02-01 22:26:37 UTC; 11min ago
systemd: 255.3-1-arch
CGroup: /
├─init.scope
│ ├─ 1 /usr/lib/systemd/systemd --system --log-target=console --unit=multi-user.target
│ ├─ 951 script -c "cat /var/console" /dev/null
│ ├─ 954 cat /var/console
│ ├─1045 /usr/sbin/bash -l
│ ├─1939 /usr/sbin/bash -l
│ ├─1949 systemctl status // <- status command and shell is here
│ └─1950 less
├─system.slice
// you get the idea ...
However using machinectl to make systemd start a shell for you works around this issue:
[siryellsalot@test ~]$ for i in {1..400} ; do ( sleep 1024 & ); done
[siryellsalot@test ~]$ systemctl status
● test.gengar
State: running
Units: 563 loaded (incl. loaded aliases)
Jobs: 0 queued
Failed: 0 units
Since: Thu 2024-02-01 22:26:37 UTC; 20min ago
systemd: 255.3-1-arch
CGroup: /
├─init.scope
│ ├─ 1 /usr/lib/systemd/systemd --system --log-target=console --unit=multi-user.target
│ ├─ 951 script -c "cat /var/console" /dev/null
│ ├─ 954 cat /var/console
│ ├─1045 /usr/sbin/bash -l
│ ├─1939 /usr/sbin/bash -l
│ ├─1951 sudo machinectl shell siryellsalot@.host
│ ├─1952 sudo machinectl shell siryellsalot@.host
│ ├─1953 machinectl shell siryellsalot@.host
│ ├─2780 /usr/sbin/bash -l
│ ├─2790 systemctl status
│ └─2791 less
├─system.slice
│ ├─dbus-broker.service
│ │ ├─1050 /usr/bin/dbus-broker-launch --scope system --audit
│ │ └─1057 dbus-broker --log 4 --controller 9 --machine-id a33d0612fca8459588a9801705f6f80e --max-bytes 53687>
│ ├─systemd-journald.service
│ │ └─1019 /usr/lib/systemd/systemd-journald
│ ├─systemd-logind.service
│ │ └─1058 /usr/lib/systemd/systemd-logind
│ └─systemd-machined.service
│ └─1954 /usr/lib/systemd/systemd-machined
└─user.slice
├─user-1000.slice
│ ├─session-3.scope
│ │ ├─1955 /usr/sbin/bash -l <- new shell is here
│ │ ├─1981 sleep 1024
│ │ ├─1983 sleep 1024
│ │ ├─1985 sleep 1024
// sleeping beauty be like:
This doesn't work to fix the my original use case, which was to use VsCode + Platform IO (that hit the limit) because``machinectl shell``` discards all stuff that distrobox does to integrate with host.
Any ideas?
The workaround also only raises the limit to somewhere around 660 however that should still be enough