Don't set owner, group, mode unless unpacking the archive #30
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.