diff --git a/warden/lib/warden/container/features/mem_limit.rb b/warden/lib/warden/container/features/mem_limit.rb index ff3d737a4..f5598978b 100644 --- a/warden/lib/warden/container/features/mem_limit.rb +++ b/warden/lib/warden/container/features/mem_limit.rb @@ -20,7 +20,7 @@ class OomNotifier def initialize(container) @container = container - oom_notifier_path = File.expand_path("../../../../../src/oom", __FILE__) + oom_notifier_path = File.expand_path("../../../../../src/oom/oom", __FILE__) @child = DeferredChild.new(oom_notifier_path, container.cgroup_root_path) # Zero exit status means a process OOMed, non-zero means an error occurred diff --git a/warden/src/.gitignore b/warden/src/.gitignore deleted file mode 100644 index b31faa591..000000000 --- a/warden/src/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/runner -/report_quota -*.o diff --git a/warden/src/Makefile b/warden/src/Makefile index d1ab12fea..24b8b4304 100644 --- a/warden/src/Makefile +++ b/warden/src/Makefile @@ -1,25 +1,8 @@ -OPTIMIZATION?=-O0 -DEBUG?=-g -ggdb -rdynamic -BINS=report_quota runner clone +default: all -all: $(BINS) +# Proxy any target to the Makefiles in the per-tool directories +%: + cd clone && $(MAKE) $@ + cd oom && $(MAKE) $@ -clean: - rm -f *.o $(BINS) - -.PHONY: all clean - -report_quota: report_quota.o - $(CC) -o $@ $^ - -runner: runner.o - $(CC) -o $@ $^ - -clone: clone.o - $(CC) -o $@ -lutil $^ - -oom: oom.o - $(CC) -o $@ $^ - -%.o: %.c - $(CC) -c -Wall -D_GNU_SOURCE $(OPTIMIZATION) $(DEBUG) $(CFLAGS) $< +.PHONY: default diff --git a/warden/src/clone/.gitignore b/warden/src/clone/.gitignore index dd381d633..b8bd0b0ef 100644 --- a/warden/src/clone/.gitignore +++ b/warden/src/clone/.gitignore @@ -1 +1,2 @@ clone +*.o diff --git a/warden/src/oom/.gitignore b/warden/src/oom/.gitignore new file mode 100644 index 000000000..60173a88b --- /dev/null +++ b/warden/src/oom/.gitignore @@ -0,0 +1,2 @@ +oom +*.o diff --git a/warden/src/oom/Makefile b/warden/src/oom/Makefile new file mode 100644 index 000000000..20a299639 --- /dev/null +++ b/warden/src/oom/Makefile @@ -0,0 +1,15 @@ +OPTIMIZATION?=-O0 +DEBUG?=-g -ggdb -rdynamic + +all: oom + +clean: + rm -f *.o oom + +.PHONY: all clean + +oom: oom.o + $(CC) -o $@ -lutil $^ + +%.o: %.c + $(CC) -c -Wall -D_GNU_SOURCE $(OPTIMIZATION) $(DEBUG) $(CFLAGS) $< diff --git a/warden/src/oom.c b/warden/src/oom/oom.c similarity index 100% rename from warden/src/oom.c rename to warden/src/oom/oom.c