Hi Ben, Thanks for the response, we are running the same script in the cron job in each hour to check user and to add / delete user account.
The problem is when a new user joins the cluster, the user cannot submit job immediately until the cron job is running to add the user to the slurm account database. That's why I've been thinking how to add user to slurm account database in realtime so the user does not need to wait the cron job. The other solution is to run cron job even more frequently, but I don't like it either. The better solution for creating user account is not polled by cron job, rather than if it can be pushed as soon as the user is active. Appreciate your comments. Kind regards, - j On 2/19/15, Ben Polman <[email protected]> wrote: > jupiter wrote on 02/19/15 06:03: > > Hi Jupiter, > > it depends on how your users are known on the slurm headnode. > We use a script which runs everyday to ensure that only users in a certain > unix group are allowed to use the cluster. > > The script adds and deletes users as needed. > > it is short so I include it here in case you can modify it for your needs > > > #!/bin/bash > > users=`getent group astro | sed -e 's/.*://;s/,/ /g'` > > slurm_users=`/usr/local/slurm/bin/sacctmgr show users | grep astro | awk > '{print $1}'` > > # echo $slurm_users > > for user in $users; do > # echo "#$user#" > if [[ "$slurm_users" =~ $user ]]; then > echo "user $user already in astro account"; > else > /usr/local/slurm/bin/sacctmgr -i create user $user account=astro > defaultaccount=astro; > fi > done > > for user in $slurm_users; do > # echo "#$user#" > if [[ "$users" =~ $user ]]; then > echo "user $user in astro group"; > else > /usr/local/slurm/bin/sacctmgr -i delete user name=$user > cluster=coma; > fi > done > > > best regards > Ben Polman > >> Create user slurm account >> Hi, >> >> A user needs to create slurm account before being able to submit job. I've >> been thinking to run a script in slurm >> prolog to check if a user account does not exist, create the user account >> in prolog (I think it is running in root, >> should have permission to call sacctmgr) . But, will the prolog be called >> if the user does not have a slurm account? >> Also, can the sacctmgr be run in non-slurm control node? >> >> Appreciate if you have better solution to create user account without >> involving manual intervention. >> >> Thank you. >> >> Kind regards, >> >> - j >> >> > > > -- > --------------------------------------------------------------------- > Dr. B.J.W. Polman, C&CZ, Radboud University. > Osiris beheerder NWI > Heyendaalseweg 135, 6525 AJ Nijmegen, The Netherlands, Phone: > +31-24-3653360 > e-mail: [email protected] > >
