bryanwb/chef-ark — pull request #30 by jdutton (2012-10-29 20:28:27+00:00)
Title: Don't set owner, group, mode unless unpacking the archive

I am using ark to install Tomcat (also derived from a @bryanwb cookbook), and I noticed that Tomcat was restarting every time I did a chef run. The root cause was because of the recursive FileUtils.chown_R and FileUtils.chmod_R called unconditionally from action_set_owner(), which is called from action_install() and action_put().

Inside my exploded Tomcat, I have some config XML files and WAR files that do not have 755 permissions (which is what ark is recursively setting). When chef runs, the ark recipe changes my war and config files to 755 and then when my template and remote_file resources run to set up XML and WAR files they change the permissions back. This falsely triggers service tomcat to restart every chef run.

The way ark is now, the only permissions that will avoid this behavior is if every file under the exploded archive has user and group match the ark archive and has a 755 permission level.

I think a reasonable fix is to only change the permissions when unpacking.