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

Merge branch 'slurm-2.2'

parents 506d00fd b7a4a70d
No related branches found
No related tags found
No related merge requests found
...@@ -204,6 +204,9 @@ documents those changes that are of interest to users and admins. ...@@ -204,6 +204,9 @@ documents those changes that are of interest to users and admins.
======================== ========================
-- Eliminate zombie process created if salloc exits with stopped child -- Eliminate zombie process created if salloc exits with stopped child
process. Patch from Gerrit Renker, CSCS. process. Patch from Gerrit Renker, CSCS.
-- With default configuration on non-Cray systems, enable salloc to be
spawned as a background process. Based upon work by Don Albert (Bull) and
Gerrit Renker (CSCS).
* Changes in SLURM 2.2.6 * Changes in SLURM 2.2.6
======================== ========================
......
...@@ -219,6 +219,7 @@ int main(int argc, char *argv[]) ...@@ -219,6 +219,7 @@ int main(int argc, char *argv[])
* a) input is from a terminal (stdin has valid termios attributes), * a) input is from a terminal (stdin has valid termios attributes),
* b) controlling terminal exists (non-negative tpgid), * b) controlling terminal exists (non-negative tpgid),
* c) salloc is not run in allocation-only (--no-shell) mode, * c) salloc is not run in allocation-only (--no-shell) mode,
* NOTE: d and e below are configuration dependent
* d) salloc runs in its own process group (true in interactive * d) salloc runs in its own process group (true in interactive
* shells that support job control), * shells that support job control),
* e) salloc has been configured at compile-time to support background * e) salloc has been configured at compile-time to support background
...@@ -234,10 +235,10 @@ int main(int argc, char *argv[]) ...@@ -234,10 +235,10 @@ int main(int argc, char *argv[])
error("no controlling terminal: please set --no-shell"); error("no controlling terminal: please set --no-shell");
exit(error_exit); exit(error_exit);
} }
#ifdef SALLOC_RUN_FOREGROUND
} else if ((!opt.no_shell) && (pid == getpgrp())) { } else if ((!opt.no_shell) && (pid == getpgrp())) {
if (tpgid == pid) if (tpgid == pid)
is_interactive = true; is_interactive = true;
#ifdef SALLOC_RUN_FOREGROUND
while (tcgetpgrp(STDIN_FILENO) != pid) { while (tcgetpgrp(STDIN_FILENO) != pid) {
if (!is_interactive) { if (!is_interactive) {
error("Waiting for program to be placed in " error("Waiting for program to be placed in "
...@@ -246,8 +247,12 @@ int main(int argc, char *argv[]) ...@@ -246,8 +247,12 @@ int main(int argc, char *argv[])
} }
killpg(pid, SIGTTIN); killpg(pid, SIGTTIN);
} }
#endif
} }
#else
} else if (!opt.no_shell) {
is_interactive = true;
}
#endif
/* /*
* Reset saved tty attributes at exit, in case a child * Reset saved tty attributes at exit, in case a child
* process died before properly resetting terminal. * process died before properly resetting terminal.
......
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