Ask Your Question

File mode => 6050 weird behaviour- doesn't apply permsion + owner group at once

asked 2014-01-10 08:15:43 -0600

jaksky gravatar image

updated 2014-01-14 11:10:55 -0600


I need to alter permission on a existing file which was created during rpm installation. I use

file { '/usr/lib/hadoop-yarn/bin/container-executor':
   ensure => present,
   group  => $hadoop::hadoop_group,
   owner  => 'root',
   mode   => 6050,

Quite often that is not the state founded after puppet run. I noticed that once the owner and group is changed, second time priviledges changed etc.

When I re-run the puppet apply than all is ok, permissions get changed. Nearly every time there is just one step, either changing permissions or owner+group. But to change it at once is very unusual in this case.

Does anybody ... (more)

edit retag flag offensive close merge delete


Are you sure this is not mode 0650 (octal notation) rather than 6050 ? I do not know what 6050 means in terms of authorization.

doc75 gravatar imagedoc75 ( 2014-01-14 14:36:54 -0600 )edit
jaksky gravatar imagejaksky ( 2014-01-15 02:52:24 -0600 )edit

OK, I've never see this ;-) Second idea: are you sure the file is executed after the rpm installation ? If not this could explan the strange behavior (first time file ...(more)

doc75 gravatar imagedoc75 ( 2014-01-15 04:15:34 -0600 )edit

I have this in dedicated class called directories. rpm installation is in dedicated class install. I had the same supposition. class { 'hadoop::install': before => Class['hadoop::directories'] } class { 'hadoop::directories ...(more)

jaksky gravatar imagejaksky ( 2014-01-15 04:55:15 -0600 )edit

Does the ordering of classes order the apply of internally defined resources? To me it seems wierd as well as I believe that functionality is used quite offten. The only ...(more)

jaksky gravatar imagejaksky ( 2014-01-15 04:55:56 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2016-02-07 17:55:03 -0600

Henrik Lindberg gravatar image

File mode must be a string value or you will get an octal integer value if you are using Puppet 3.x with parser=future or 4.x. Later versions will error if it is not a string, but that was not the case in earlier versions when future parser is in effect.

File mode does indeed have higher order bits; 06050 means

  • set user id on execution (04000)
  • set group id on execution (02000)
  • read by group 0040
  • search by group (0010)

Could it be that you are sometimes using future parser and sometimes not? That would explain why it works some of the time but not always. Quoting the value as '6050' should make it work in all cases if it is the octal vs decimal that is biting you.

If that is not the case then it sounds like a bug.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2014-01-10 08:15:43 -0600

Seen: 244 times

Last updated: Jan 14 '14