[gridengine users] Automatically creating home directories before job execution

Ilya M 4ilya.m+grid at gmail.com
Tue Jul 30 21:12:24 UTC 2019


Hello,

I am setting up a new SGE cluster (with old SGE) with local users' home
directories on the nodes. Those directories might not exists at the time of
job execution, so I need to have SGE create them before jobs are executed.

I added the following lines to my prolog script:

HOMEDIR=$(eval echo ~${USER});
if [[ ! -d ${HOMEDIR} ]]; then
  sudo /sbin/mkhomedir_helper ${USER}
fi

I tried to run prolog both as a 'sgegrid' user that has sudo privileges to
execute the command, and as root. However, neither of the attempts worked:
the job still failed:

07/30/2019 20:36:28 [973525570:34481]: error: can't chdir to /home/ilya: No
such file or directory

I also tried to run this as a global prolog and as a queue-level prolog to
no avail.

Running the prolog script manually on the node creates home directory
without a problem, so the syntax and logic seem to be correct.

Furthermore, I have the following set at the top on prolog script to allow
some logging:

set -x

LOG=/tmp/prolog_${1}.log
exec 6>&1
exec > $LOG 2>$LOG

However, the log file is not getting created, which makes me think that the
failure happens before prolog starts to execute.

Shell settings for the queue are as follows:
shell                 /bin/sh
shell_start_mode      posix_compliant

starter_method is not set.

Would appreciate any suggestions for making this work or at least getting
meaningful debug output.

Thank you.
Ilya.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://gridengine.org/pipermail/users/attachments/20190730/c3e4211a/attachment.html>


More information about the users mailing list