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

Added etc/slurm.epilog.clean to kill processes initiated outside of

    slurm when a user's last job on a node terminates.
parent 51ba40a3
No related branches found
No related tags found
No related merge requests found
...@@ -9,6 +9,7 @@ EXTRA_DIST = \ ...@@ -9,6 +9,7 @@ EXTRA_DIST = \
etc/bluegene.conf.example \ etc/bluegene.conf.example \
etc/federation.conf.example \ etc/federation.conf.example \
etc/slurm.conf.example \ etc/slurm.conf.example \
etc/slurm.epilog.clean \
etc/init.d.slurm \ etc/init.d.slurm \
etc/ptrace.patch \ etc/ptrace.patch \
autogen.sh \ autogen.sh \
......
This file describes changes in recent versions of SLURM. It primarily This file describes changes in recent versions of SLURM. It primarily
documents those changes that are of interest to users and admins. 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 * Changes in SLURM 0.6.0-pre3
============================= =============================
-- Add code so job request for shared nodes gets explicitly requested -- Add code so job request for shared nodes gets explicitly requested
......
...@@ -218,7 +218,7 @@ the <b>slurmd</b> daemon. LAM/MPI version 7.1 or higher contains support for ...@@ -218,7 +218,7 @@ the <b>slurmd</b> daemon. LAM/MPI version 7.1 or higher contains support for
SLURM. SLURM.
Set the <b>MpiDefault=lam</b> configuration parameters in slurm.conf.</p> 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>. <a href="http://www.open-mpi.org/">Open MPI</a>.
Set the <b>MpiDefault=lam</b> configuration parameters in slurm.conf Set the <b>MpiDefault=lam</b> configuration parameters in slurm.conf
for use of Open MPI.</p> for use of Open MPI.</p>
...@@ -291,7 +291,8 @@ When installed, the SLURM PAM module will prevent users from logging ...@@ -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. into any node that has not be assigned to that user.
On job termination, any processes initiated by the user outside of On job termination, any processes initiated by the user outside of
SLURM's control may be killed using an <i>Epilog</i> script configured 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, Without these mechanisms any user can login to any compute node,
even those allocated to other users.</p> even those allocated to other users.</p>
......
#!/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
...@@ -147,6 +147,7 @@ fi ...@@ -147,6 +147,7 @@ fi
install -D -m644 etc/slurm.conf.example ${RPM_BUILD_ROOT}%{_sysconfdir}/slurm.conf.example 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/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 -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: # Delete unpackaged files:
rm -f $RPM_BUILD_ROOT/%{_libdir}/slurm/*.{a,la} rm -f $RPM_BUILD_ROOT/%{_libdir}/slurm/*.{a,la}
...@@ -229,6 +230,7 @@ rm -rf $RPM_BUILD_ROOT ...@@ -229,6 +230,7 @@ rm -rf $RPM_BUILD_ROOT
%{_libdir}/slurm/mpi_lam.so %{_libdir}/slurm/mpi_lam.so
%dir %{_libdir}/slurm/src %dir %{_libdir}/slurm/src
%config %{_sysconfdir}/slurm.conf.example %config %{_sysconfdir}/slurm.conf.example
%config %{_sysconfdir}/slurm.epilog.clean
############################################################################# #############################################################################
%files devel %files devel
...@@ -305,6 +307,8 @@ fi ...@@ -305,6 +307,8 @@ fi
%changelog %changelog
* Thu Sep 01 2005 Morris Jette <jette1@llnl.gov>
- added etc/slurm.epilog.clean
* Fri Jul 22 2005 Mark Grondona <mgrondona@llnl.gov> * Fri Jul 22 2005 Mark Grondona <mgrondona@llnl.gov>
- explicitly set modes and owner of %prefix/include/slurm - explicitly set modes and owner of %prefix/include/slurm
* Fri Jun 17 2005 Morris Jette <jette1@llnl.gov> * Fri Jun 17 2005 Morris Jette <jette1@llnl.gov>
......
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