From becb9faff6c8dd8d6715965b0200c7916c1efacc Mon Sep 17 00:00:00 2001 From: Donald Buczek Date: Thu, 3 Sep 2015 14:18:30 +0200 Subject: [PATCH] mxqd: set TMPDIR --- Makefile | 5 +++-- mxqd.c | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index b93cce9..9f12067 100644 --- a/Makefile +++ b/Makefile @@ -74,8 +74,8 @@ OS_RELEASE = $(shell ./os-release) # special defaults for mariux64 ifeq (${OS_RELEASE}, mariux64) - MXQ_INITIAL_PATH := ${MXQ_INITIAL_PATH}:/usr/local/package/bin - + MXQ_INITIAL_PATH := ${MXQ_INITIAL_PATH}:/usr/local/package/bin + CFLAGS_MXQ_INITIAL_TMPDIR = -DMXQ_INITIAL_TMPDIR=\"/scratch/local\" endif ######################################################################## @@ -378,6 +378,7 @@ mxqd.o: $(mxq_job.h) mxqd.o: $(mx_mysql.h) mxqd.o: CFLAGS += $(CFLAGS_MYSQL) mxqd.o: CFLAGS += $(CFLAGS_MXQ_INITIAL_PATH) +mxqd.o: CFLAGS += $(CFLAGS_MXQ_INITIAL_TMPDIR) mxqd.o: CFLAGS += -Wno-unused-but-set-variable clean: CLEAN += mxqd.o diff --git a/mxqd.c b/mxqd.c index 633f711..5a8eaf0 100644 --- a/mxqd.c +++ b/mxqd.c @@ -779,6 +779,9 @@ static int init_child_process(struct mxq_group_list *group, struct mxq_job *j) mx_setenv_forever("USERNAME", g->user_name); mx_setenv_forever("LOGNAME", g->user_name); mx_setenv_forever("PATH", MXQ_INITIAL_PATH); +#ifdef MXQ_INITIAL_TMPDIR + mx_setenv_forever("TMPDIR", MXQ_INITIAL_TMPDIR); +#endif mx_setenv_forever("PWD", j->job_workdir); mx_setenv_forever("HOME", passwd->pw_dir); mx_setenv_forever("SHELL", passwd->pw_shell);