Skip to content

Commit

Permalink
create: add pid-limits=-1 to create, Fix #1183
Browse files Browse the repository at this point in the history
Signed-off-by: Luca Di Maio <[email protected]>
  • Loading branch information
89luca89 committed Feb 3, 2024
1 parent ed5c620 commit 54cfcbe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion distrobox-create
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ Usage:
distrobox create --image alpine:latest --name test --init-hooks "touch /var/tmp/test1 && touch /var/tmp/test2"
distrobox create --image fedora:39 --name test --additional-flags "--env MY_VAR-value"
distrobox create --image fedora:39 --name test --volume /opt/my-dir:/usr/local/my-dir:rw --additional-flags "--pids-limit -1"
distrobox create --image fedora:39 --name test --volume /opt/my-dir:/usr/local/my-dir:rw --additional-flags "--pids-limit 100"
distrobox create -i docker.io/almalinux/8-init --init --name test --pre-init-hooks "dnf config-manager --enable powertools && dnf -y install epel-release"
distrobox create --clone fedora-39 --name fedora-39-copy
distrobox create --image alpine my-alpine-container
Expand Down Expand Up @@ -570,6 +570,7 @@ generate_command() {
--privileged
--security-opt label=disable
--security-opt apparmor=unconfined
--pids-limit=-1
--user root:root"

if [ "${unshare_ipc}" -eq 0 ]; then
Expand Down
4 changes: 2 additions & 2 deletions distrobox-init
Original file line number Diff line number Diff line change
Expand Up @@ -2192,15 +2192,15 @@ printf "distrobox: Firing up init system...\n"
if [ -e /usr/lib/systemd/systemd ] || [ -e /lib/systemd/systemd ]; then
# Start user Systemd unit, this will attempt until Systemd is ready
sh -c "while true; do \
sleep 1; \
sleep 5; \
systemctl start user@${container_user_name}.service 2>/dev/null && \
systemctl start user-integration@${container_user_name}.service 2>/dev/null && \
exit 0; \
done" &

sh -c " while true; do \
systemctl is-system-running && break; \
printf >&2 'waiting for systemd to come up...\n' && sleep 1; \
printf >&2 'waiting for systemd to come up...\n' && sleep 5; \
done; \
printf container_setup_done" &

Expand Down

0 comments on commit 54cfcbe

Please sign in to comment.