[[chef-dev]] Re: [[chef-dev]] Re: [[chef-dev]] CHEF-1621 - "recursive" attributeon "directory" resource does not apply users and groups to entire path


Chronological Thread 
  • From: Seth Falcon < >
  • To: Chad Woolley < >
  • Cc: Thomas Bishop < >,
  • Subject: [[chef-dev]] Re: [[chef-dev]] Re: [[chef-dev]] CHEF-1621 - "recursive" attributeon "directory" resource does not apply users and groups to entire path
  • Date: Sun, 3 Oct 2010 21:06:33 -0700

Hi all,

I'm glad to see some discussion of this issue hitting the list.  It's
clear from a quick search of the chef bug database, that this is
something that keeps coming up.  For example, see:

http://tickets.opscode.com/browse/CHEF-205
http://tickets.opscode.com/browse/CHEF-1327
http://tickets.opscode.com/browse/CHEF-1621

And related:
http://tickets.opscode.com/browse/CHEF-690
http://tickets.opscode.com/browse/CHEF-933

Although it may confuse some users, there is agreement that having
chef change ownership of already existing parent directories is not
desirable.

The question is about the ownership of parent directories that are
created as a result of the "mkdir -p" :recursive option to the
Directory resource.

On Sun, Oct 3, 2010 at 5:42 PM, Chad Woolley 
< >
 wrote:
> I'm assuming that if I'm issuing a command to create something (e.g. a
> directory tree) for a non-root user, *everything* that command creates
> should be owned by that non-root user.  If I wanted part of my
> directory tree owned by root, I would do that with a separate command
> without the owner specified.

Initially, I shared this perspective about created parent directories
being owned by the user/group specified in the resource.  It seems to
balance the convenience provided by the option; to achieve
root-owns-created-parents, one extra resource call is required,
whereas to get the specified user to own the entire tree is one call
instead of a call for each level (assuming these dirs don't already
exist with different ownership).

But it's that last part that gives me doubt about the right thing to
do.  If you want to rely on parent directories having the same owner
as the leaf dir, then you should specify that explicitly.

While I find the specified-user-owns-created-parents behavior least
surprising, I have concerns that it is ultimately not useful.  If you
actually need the results of that behavior, you should do it
explicitly else your recipe will be brittle.

So if I was to choose, I think I would leave current behavior as-is,
and add some notes to the documentation to clarify what happens when
parent directories are created.

Cheers,

+ seth



Archive powered by MHonArc 2.6.16.

§