Skip to content

Commit

Permalink
mxqd: Clean up setting initial TMPDIR
Browse files Browse the repository at this point in the history
clean up becb9fa
  • Loading branch information
mariux committed Sep 21, 2015
1 parent faf268d commit 90ef264
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,13 @@ CGIDIR = ${LIBEXECDIR}/mxq/cgi
MXQ_MYSQL_DEFAULT_FILE = ${SYSCONFDIR}/mxq/mysql.cnf
MXQ_MYSQL_DEFAULT_GROUP = mxqclient

MXQ_INITIAL_PATH = /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin
MXQ_INITIAL_PATH = /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin
MXQ_INITIAL_TMPDIR = /tmp

CFLAGS_MXQ_MYSQL_DEFAULT_FILE = -DMXQ_MYSQL_DEFAULT_FILE=\"$(MXQ_MYSQL_DEFAULT_FILE)\"
CFLAGS_MXQ_MYSQL_DEFAULT_GROUP = -DMXQ_MYSQL_DEFAULT_GROUP=\"$(MXQ_MYSQL_DEFAULT_GROUP)\"
CFLAGS_MXQ_INITIAL_PATH = -DMXQ_INITIAL_PATH=\"$(MXQ_INITIAL_PATH)\"
CFLAGS_MXQ_INITIAL_TMPDIR = -DMXQ_INITIAL_TMPDIR=\"$(MXQ_INITIAL_TMPDIR)\"

MYSQL_CONFIG = mysql_config

Expand All @@ -75,7 +77,7 @@ OS_RELEASE = $(shell ./os-release)
# special defaults for mariux64
ifeq (${OS_RELEASE}, mariux64)
MXQ_INITIAL_PATH := ${MXQ_INITIAL_PATH}:/usr/local/package/bin
CFLAGS_MXQ_INITIAL_TMPDIR = -DMXQ_INITIAL_TMPDIR=\"/scratch/local\"
MXQ_INITIAL_TMPDIR := /scratch/local
endif

########################################################################
Expand Down
8 changes: 5 additions & 3 deletions mxqd.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@
#define MYSQL_DEFAULT_FILE MXQ_MYSQL_DEFAULT_FILE
#define MYSQL_DEFAULT_GROUP "mxqd"

#ifndef MXQ_INITIAL_TMPDIR
# define MXQ_INITIAL_TMPDIR "/tmp"
#endif

volatile sig_atomic_t global_sigint_cnt=0;
volatile sig_atomic_t global_sigterm_cnt=0;

Expand Down Expand Up @@ -779,9 +783,7 @@ 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("TMPDIR", MXQ_INITIAL_TMPDIR);
mx_setenv_forever("PWD", j->job_workdir);
mx_setenv_forever("HOME", passwd->pw_dir);
mx_setenv_forever("SHELL", passwd->pw_shell);
Expand Down

0 comments on commit 90ef264

Please sign in to comment.