On Aug 9, 10:27 am, Martin Alfke <tux...@gmail.com> wrote:
> Hi,
>
> 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

Solution:
in type/user/hpux.rb:

  def modifycmd(param,value)
#    super.insert(1,"-F")
        cmd = [command(:modify)]
        cmd << "-F"
        cmd += add_properties
        if @resource[:allowdupe]
                cmd << "-o"
        end
        cmd << @resource[:name]
  end
end

Any suggestions whether this change should be done better?

Regards,

Martin

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to