Re: /run/user/$UID not created


Adrian Reber
 

On Tue, Nov 26, 2019 at 05:46:28AM +0000, Irek Porebski via Groups.Io wrote:
Hi All,

We are running Slurm on Centos 7.X with munge.
On our cluster users are long using SSH to head node. The folder /var/run/$UID is created as expected.
However when user is connecting to compute node using "srun" the /var/run/$UID folder is not created.
The authentication is performed by munge and the SSH access is restricted only to nodes where user has running jobs.
Even if user connect using SSH the /var/run/$UID is still not created.

I am not sure what causing /var/run/$UID to not be created.
For most of our terminal jobs this is not important however X11 jobs required this folder temporary files.

If someone can point me in the right direction I would appreciate that.
I have had the same problem. I think the reason is that slurm does not
go through logind when the nodes are assigned. I worked around this with
a prolog and epilog script:

$ cat files/slurm.prolog
#!/bin/sh

if [ x$SLURM_JOB_UID = "x" ] ; then
exit 0
fi
if [ x$SLURM_JOB_ID = "x" ] ; then
exit 0
fi

if [ $SLURM_JOB_UID -lt 100 ] ; then
exit 0
fi

mkdir /run/user/$SLURM_JOB_UID
chown $SLURM_JOB_UID:`id -g $SLURM_JOB_UID` /run/user/$SLURM_JOB_UID
chmod 711 /run/user/$SLURM_JOB_UID
exit 0

And following line to slurm.epilog.clean:

rm -rf /run/user/$SLURM_UID

I would prefer to have a correct solution involving logind
(pam_systemd) instead of this hack, but this worked for me.

Adrian

Join OpenHPC-users@groups.io to automatically receive all group messages.