Hi Loris, Not sure if this helps you, sorry if not. I can't answer the specifics of your query about how sacctmgr works.
Here are the relevant bits from our account setup workflow to add a users account to an account, the first line, then set their default account to it. sbank project useradd -c $cluster -a $project_code -u $user sacctmgr -i update users cluster=$cluster set defaultaccount=$project_code where user=$user,cluster=$cluster I've used the `sacctmgr -i update ...` step to change the default account for users subsequently after accounts have been created. Hope that helps, sorry if not. Sean On Tue, Nov 23, 2021 at 01:50:01PM +0100, Loris Bennett wrote: > Hi, > > Occasionally I need to change a default account and I struggle every > time, possibly because my expectations are incorrect. > > However the messages and the manpage seem to me unhelpful: > > $ sacctmgr show user alice accounts > User Def Acct Admin > ---------- ---------- --------- > alice boblab None > > $ sacctmgr add user user=alice defaultaccount=carollab cluster=bigiron > Nothing new added. > > $ sacctmgr show user alice accounts > User Def Acct Admin > ---------- ---------- --------- > alice boblab None > > What does "Nothing new added" mean? > > In the manpage for sacctmgr it says: > > DefaultAccount= > System wide default account name > Must be defined on the first occurrence of the user. > > I find the third line unclear, but I assume it means > > Must be specified when the user is created (and cannot be modified > subsequently) > > Deleting the user and recreating with the desired defaultaccount is the > only way I have managed change the default account. > > Is this really the only way to achieve this? > > Cheers, > > Loris > > -- > Dr. Loris Bennett (Herr/Mr) > ZEDAT, Freie Universität Berlin Email loris.benn...@fu-berlin.de > -- Sean McGrath M.Sc Systems Administrator Trinity Centre for High Performance and Research Computing Trinity College Dublin sean.mcgr...@tchpc.tcd.ie https://www.tcd.ie/ https://www.tchpc.tcd.ie/ +353 (0) 1 896 3725