diff --git a/Makefile.am b/Makefile.am index 43ae349ca28b99e121bfd052e069c18eb970e537..818e40bf9ffa14e63de27432201f0b19cfac9297 100644 --- a/Makefile.am +++ b/Makefile.am @@ -9,6 +9,7 @@ EXTRA_DIST = \ etc/bluegene.conf.example \ etc/federation.conf.example \ etc/slurm.conf.example \ + etc/slurm.epilog.clean \ etc/init.d.slurm \ etc/ptrace.patch \ autogen.sh \ diff --git a/NEWS b/NEWS index ca46308744d7055fda403818ded1c4d18c13517d..d3be006f1fa282215faa5ffd3268dab33eefe976 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,11 @@ This file describes changes in recent versions of SLURM. It primarily documents those changes that are of interest to users and admins. +* Changes in SLURM 0.6.0-pre4 +============================= + -- Added etc/slurm.epilog.clean to kill processes initiated outside of + slurm when a user's last job on a node terminates. + * Changes in SLURM 0.6.0-pre3 ============================= -- Add code so job request for shared nodes gets explicitly requested diff --git a/doc/html/quickstart_admin.html b/doc/html/quickstart_admin.html index 17a627821712a0b3ab3e1a1d2ef239d816de2e1e..320959538e5357be2c7edf1c53113b6f1f23d4e7 100644 --- a/doc/html/quickstart_admin.html +++ b/doc/html/quickstart_admin.html @@ -218,7 +218,7 @@ the <b>slurmd</b> daemon. LAM/MPI version 7.1 or higher contains support for SLURM. Set the <b>MpiDefault=lam</b> configuration parameters in slurm.conf.</p> -<p>Another good pen-source MPI for use with SLURM is +<p>Another good open-source MPI for use with SLURM is <a href="http://www.open-mpi.org/">Open MPI</a>. Set the <b>MpiDefault=lam</b> configuration parameters in slurm.conf for use of Open MPI.</p> @@ -291,7 +291,8 @@ When installed, the SLURM PAM module will prevent users from logging into any node that has not be assigned to that user. On job termination, any processes initiated by the user outside of SLURM's control may be killed using an <i>Epilog</i> script configured -in <i>slurm.conf</i>. +in <i>slurm.conf</i>. +An example of such a script is included as <i>etc/slurm.epilog.clean</i>. Without these mechanisms any user can login to any compute node, even those allocated to other users.</p> diff --git a/etc/slurm.epilog.clean b/etc/slurm.epilog.clean new file mode 100644 index 0000000000000000000000000000000000000000..920bc4f95b16ba476c5e5b5f1c2ae487abdeb1aa --- /dev/null +++ b/etc/slurm.epilog.clean @@ -0,0 +1,36 @@ +#!/bin/sh +# +# This script will kill any user processes on a node when the last +# SLURM job there ends. For example, if a user directly logs into +# an allocated node SLURM will not kill that process without this +# script being executed as an epilog. +# +# SLURM_BIN can be used for testing with private version of SLURM +#SLURM_BIN="/usr/bin/" +# +if [ x$SLURM_UID == "x" ] ; then + exit 0 +fi +if [ x$SLURM_JOBID == "x" ] ; then + exit 0 +fi + +# +# Don't try to kill user root or system daemon jobs +# +if [ $SLURM_UID -lt 100 ] ; then + exit 0 +fi + +job_list=`${SLURM_BIN}squeue --noheader --format=%i --user=$SLURM_UID --node=localhost` +for job_id in $job_list +do + if [ $job_id -ne $SLURM_JOBID ] ; then + exit 0 + fi +done + +# +# No other jobs, purge jobs of this user +# +pkill -KILL -U $SLURM_UID diff --git a/slurm.spec b/slurm.spec index 20ce381a3b0cecb0ccb22971e2349728441544bc..d27c6b37a5ca2da461e16c58ccef561603b4d0fc 100644 --- a/slurm.spec +++ b/slurm.spec @@ -147,6 +147,7 @@ fi install -D -m644 etc/slurm.conf.example ${RPM_BUILD_ROOT}%{_sysconfdir}/slurm.conf.example install -D -m644 etc/bluegene.conf.example ${RPM_BUILD_ROOT}%{_sysconfdir}/bluegene.conf.example install -D -m644 etc/federation.conf.example ${RPM_BUILD_ROOT}%{_sysconfdir}/federation.conf.example +install -D -m755 etc/slurm.epilog.clean ${RPM_BUILD_ROOT}%{_sysconfdir}/slurm.epilog.clean # Delete unpackaged files: rm -f $RPM_BUILD_ROOT/%{_libdir}/slurm/*.{a,la} @@ -229,6 +230,7 @@ rm -rf $RPM_BUILD_ROOT %{_libdir}/slurm/mpi_lam.so %dir %{_libdir}/slurm/src %config %{_sysconfdir}/slurm.conf.example +%config %{_sysconfdir}/slurm.epilog.clean ############################################################################# %files devel @@ -305,6 +307,8 @@ fi %changelog +* Thu Sep 01 2005 Morris Jette <jette1@llnl.gov> +- added etc/slurm.epilog.clean * Fri Jul 22 2005 Mark Grondona <mgrondona@llnl.gov> - explicitly set modes and owner of %prefix/include/slurm * Fri Jun 17 2005 Morris Jette <jette1@llnl.gov>