Skip to content
Snippets Groups Projects
Commit 70e1cdf4 authored by Moe Jette's avatar Moe Jette
Browse files

For srun/sbatch --get-user-env option (Moab use only) look for "env"

    command in both /bin and /usr/sbin (for Suse Linux).
parent 6c3383c3
No related branches found
No related tags found
No related merge requests found
...@@ -31,8 +31,10 @@ documents those changes that are of interest to users and admins. ...@@ -31,8 +31,10 @@ documents those changes that are of interest to users and admins.
HostFormat=2 in SLURM's wiki.conf for improved performance. HostFormat=2 in SLURM's wiki.conf for improved performance.
-- NOTE: We needed to change an RPC from version 1.3.0. You must upgrade -- NOTE: We needed to change an RPC from version 1.3.0. You must upgrade
all nodes in a cluster from v1.3.0 to v1.3.1 at the same time. all nodes in a cluster from v1.3.0 to v1.3.1 at the same time.
-- Postgres plugin will work from job accounting, not for -- Postgres plugin will work from job accounting, not for association
association management yet. management yet.
-- For srun/sbatch --get-user-env option (Moab use only) look for "env"
command in both /bin and /usr/sbin (for Suse Linux).
* Changes in SLURM 1.3.1 * Changes in SLURM 1.3.1
======================== ========================
......
...@@ -77,14 +77,17 @@ static int _get_cache_dir(char *buffer, int buf_size); ...@@ -77,14 +77,17 @@ static int _get_cache_dir(char *buffer, int buf_size);
static void _log_failures(int failures, char *cache_dir); static void _log_failures(int failures, char *cache_dir);
static int _parse_line(char *in_line, char **user_name, int *user_id); static int _parse_line(char *in_line, char **user_name, int *user_id);
char *env_loc = NULL;
main (int argc, char **argv) main (int argc, char **argv)
{ {
FILE *passwd_fd; FILE *passwd_fd;
char cache_dir[256], in_line[256], *user_name; char cache_dir[256], in_line[256], *user_name;
int i, failures = 0, user_cnt = 0, user_id; int i, failures = 0, user_cnt = 0, user_id;
long int delta_t; long int delta_t;
struct stat buf;
if (geteuid() != (uid_t)0) { if (geteuid() != (uid_t) 0) {
printf("Need to run as user root\n"); printf("Need to run as user root\n");
exit(1); exit(1);
} }
...@@ -97,6 +100,30 @@ main (int argc, char **argv) ...@@ -97,6 +100,30 @@ main (int argc, char **argv)
strerror(errno)); strerror(errno));
exit(1); exit(1);
} }
if (stat("/bgl", &buf) == 0) {
printf("BlueGene Note: Execute only a a front-end node, "
"not the service node\n");
printf(" User logins to the service node are "
"disabled\n\n");
}
if (stat("/bin/su", &buf)) {
printf("Could not locate command: /bin/su\n");
exit(1);
}
if (stat("/bin/echo", &buf)) {
printf("Could not locate command: /bin/echo\n");
exit(1);
}
if (stat("/bin/env", &buf) == 0)
env_loc = "/bin/env";
else if (stat("/usr/bin/env", &buf) == 0)
env_loc = "/usr/bin/env";
else {
printf("Could not location command: env\n");
exit(1);
}
printf("Building user environment cache files for Moab/Slurm.\n"); printf("Building user environment cache files for Moab/Slurm.\n");
printf("This will take a while.\n\n"); printf("This will take a while.\n\n");
...@@ -230,8 +257,8 @@ static long int _build_cache(char *user_name, char *cache_dir) ...@@ -230,8 +257,8 @@ static long int _build_cache(char *user_name, char *cache_dir)
open("/dev/null", O_WRONLY); open("/dev/null", O_WRONLY);
snprintf(buffer, sizeof(buffer), snprintf(buffer, sizeof(buffer),
"/bin/echo; /bin/echo; /bin/echo; " "/bin/echo; /bin/echo; /bin/echo; "
"/bin/echo %s; /bin/env; /bin/echo %s", "/bin/echo %s; %s; /bin/echo %s",
starttoken, stoptoken); starttoken, env_loc, stoptoken);
#ifdef LOAD_ENV_NO_LOGIN #ifdef LOAD_ENV_NO_LOGIN
execl("/bin/su", "su", user_name, "-c", buffer, NULL); execl("/bin/su", "su", user_name, "-c", buffer, NULL);
#else #else
......
...@@ -1326,6 +1326,10 @@ char **env_array_user_default(const char *username, int timeout, int mode) ...@@ -1326,6 +1326,10 @@ char **env_array_user_default(const char *username, int timeout, int mode)
struct pollfd ufds; struct pollfd ufds;
struct stat buf; struct stat buf;
if (stat("/bin/su", &buf))
fatal("Could not locate command: /bin/su");
if (stat("/bin/echo", &buf))
fatal("Could not locate command: /bin/echo");
if (stat("/bin/env", &buf) == 0) if (stat("/bin/env", &buf) == 0)
env_loc = "/bin/env"; env_loc = "/bin/env";
else if (stat("/usr/bin/env", &buf) == 0) else if (stat("/usr/bin/env", &buf) == 0)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment