File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ SHELL=/bin/bash
1717# This wraps the top-level make invocation inside a systemd --user scope.
1818# When the MemoryMax is exceeded, systemd OOM-kills the entire process tree.
1919# ------------------------------------------------------------------------------
20- MEM_GUARD ?= 6G
20+ MEM_GUARD ?=
2121NOMEMGUARD ?=
2222SYSTEMD_RUN := $(shell command -v systemd-run 2>/dev/null || true)
2323# Only run the guard once
@@ -32,23 +32,18 @@ endif
3232# fall back to a system scope when running as root. If neither is possible, skip with a warning.
3333define RUN_UNDER_MEMGUARD
3434@{ \
35- echo "HERROO"; \
3635echo $(SYSTEMD_RUN ) ; \
3736if [ -z "$(SYSTEMD_RUN ) " ]; then \
38- echo "I am 1"; \
3937 echo "==> [memguard] WARNING: systemd-run not found; proceeding WITHOUT memory limit."; \
4038 exit 0; \
4139fi; \
4240USER_ID="$$(id -u ) "; \
4341SCOPE_ARGS="--user --scope"; \
4442if [ "$$USER_ID" -eq 0 ]; then \
45- echo "I am 2"; \
4643 SCOPE_ARGS="--scope"; \
4744else \
48- echo "I am 3"; \
4945 if ! systemctl --user show-environment >/dev/null 2>&1; then \
5046 echo "==> [memguard] No user systemd session found (no DBus)."; \
51- echo "==> [memguard] TIP: run without sudo, or enable a user session (loginctl enable-linger ${USER})."; \
5247 if ! $(SYSTEMD_RUN ) --user --scope /bin/true >/dev/null 2>&1; then \
5348 echo "==> [memguard] Skipping memory guard (no user systemd bus)."; \
5449 exit 0; \
You can’t perform that action at this time.
0 commit comments