on HP-UX we want some users to have the same homedir.
Homedir is managed by puppet as file resource.
We now want to move the users to another primary group.
useradd.sam complains:
err: /User[XXX]/gid: change from 3 to 0 failed: Could not set gid on user[XXX]: Execution of '/usr/sam/lbin/usermod.sam -F -g 0 XXX' returned 45: Cannot modify user 'XXX': Home directory '/.root_home' is shared
This error also shows up when running the mentioned command on command line.
The following usermod.sam command is working on command line:
'/usr/sam/lbin/usermod.sam -F -d /.homedir -m -g 0 XXX'
How do I add the path and -m option to usermod for HP-UX?
I looked into provider/user/hpux.rb and found:
def modifycmd(param,value)
super.insert(1,"-F")
end
so I thought to add the required parameters:
def modifycmd(param,value)
super.insert(1,"-F -d "+home+" -m")
end
But this leads to another error message:
err: /User[XXX]/gid: change from 3 to 0 failed: Could not set gid on user[XXX]: Execution of '/usr/sam/lbin/usermod.sam -F -d /.homedir -m -g 0 XXX' returned 2: Unrecognized Option ' '
Usage: usermod.sam [-p <passwd> [-u <uid> [-o]] [-g <group> [-G <group>[,<group...> [-d <dir> [-m]] [-s <shell>] [-c <comment>] [-f <inactive>] [-e <expire>] [-l <new logname>] <login>
When using the above command with copy and paste everything is working as expected.
Any help?
Regards,
Martin