Puppet: System Administration Automated

Support

Ticket #1099 (new defect)

Opened 6 months ago

Last modified 5 months ago

Home directories do not get created when managehome is added after the user is created

Reported by: luke Assigned to: luke
Priority: normal Milestone: elmo
Component: user Version: 0.24.1
Severity: normal Keywords:
Cc: Triage Stage: Accepted
Attached Patches: Code Complexity: Easy

Description

It looks like usermod supports -d to change home directories, but even using managehome does not cause this to get used.

Change History

02/26/08 22:39:01 changed by jamtur01

Needs something like:

 if @resource.managehome?
            cmd << "-m"
        elsif %w{Fedora RedHat}.include?(Facter.value("operatingsystem"))
            cmd << "-M"
        end

for modifycmd too.

02/26/08 22:43:14 changed by jamtur01

Also poking into this - I don't see where "shell" gets used either for useradd/usermod?

02/26/08 22:56:26 changed by jamtur01

Ignore that last - worked it out. *hits head*

02/26/08 23:06:11 changed by jamtur01

if @resource.managehome? && @resource[:home] != ""
            cmd << "-d " + @resource[:home]
end

Perhaps? Though I suspect that's clumsy.

02/27/08 00:02:54 changed by luke

In looking at this, and actually testing it on my Debian box, the directory correctly gets changed, it just doesn't get *moved*.

We just need to add '-m' to the modifycmd when managehome is true, at least on Debian (and, I assume, most platforms that support useradd).

02/27/08 00:36:26 changed by jamtur01

  • owner changed from community to luke.
  • stage changed from Accepted to Ready for checkin.
  • patch changed from None to Code.

Fixed in commit [0ae58a9a6a6f201e6a32a4e9d567e04519d3f0b5] in branch 0.24.x. I checked a few platforms with useradd/usermod and -m is the normally supported method to move.

02/27/08 15:19:01 changed by luke

  • summary changed from Home directories do not get changed when managehome is enabled to Home directories do not get created when managehome is added after the user is created.

Okay, I got more detail: The problem is that adding managehome after user creation has no affect.

I guess I agree that this is more intuitive to do this, but it means that managehome would need to become a property instead of a parameter.

02/28/08 03:32:08 changed by jamtur01

Okay I reverted that commit then - because if that is the case then that's not the fix.

03/06/08 20:09:22 changed by luke

  • stage changed from Ready for checkin to Accepted.

04/24/08 07:18:40 changed by luke

  • component changed from library to user.