Execute resource shows "doing nothing" yet still triggers a service restart

Hi,

Our nginx recipe is having an issue where the “bash” resource responsible
for compiling nginx, correctly see that nothing needs to be done, yet
somehow is still triggering a restart:

[Wed, 07 Nov 2012 20:14:31 +0000] INFO: Processing
remote_file[/var/chef/cache/nginx-1.0.4.tar.gz] action create_if_missing
(nginx::source line 48)
[Wed, 07 Nov 2012 20:14:32 +0000] DEBUG:
remote_file[/var/chef/cache/nginx-1.0.4.tar.gz] exists at
/var/chef/cache/nginx-1.0.4.tar.gz taking no action.
[Wed, 07 Nov 2012 20:14:32 +0000] INFO: Processing
bash[compile_nginx_source] action run (nginx::source line 53)
[Wed, 07 Nov 2012 20:14:32 +0000] DEBUG: bash[compile_nginx_source]
sentinel file /opt/nginx-1.0.4/sbin/nginx exists - nothing to do
<…snip…>
[Wed, 07 Nov 2012 20:14:47 +0000] INFO: bash[compile_nginx_source] sending
restart action to service[nginx] (delayed)
[Wed, 07 Nov 2012 20:14:47 +0000] INFO: Processing service[nginx] action
restart (nginx::source line 98)

The bash resource is defined as:

bash “compile_nginx_source” do
cwd Chef::Config[:file_cache_path]
code <<-EOH
tar zxf nginx-#{nginx_version}.tar.gz
cd nginx-#{nginx_version} && ./configure #{configure_flags}
make && make install
EOH
creates node[:nginx][:src_binary]
end

This only affects one out of 4 nodes we’re running this cookbook on…the
other 3 correctly notice the binary is present and do not run the restart.
The client is 10.14.2

I’ve tried removing the compiled nginx directory and clearing out the
cached .tgz of the source to see if a clean run fixes it, but no dice. I’m
really befuddled why Chef Client clearly declares no action is necessary
and still a restart is triggered on this node. Any help/advice is greatly
appreciated.

-J

On Wednesday, November 7, 2012 at 12:20 PM, Jason J. W. Williams wrote:

Hi,

Our nginx recipe is having an issue where the "bash" resource responsible for compiling nginx, correctly see that nothing needs to be done, yet somehow is still triggering a restart:

[Wed, 07 Nov 2012 20:14:31 +0000] INFO: Processing remote_file[/var/chef/cache/nginx-1.0.4.tar.gz] action create_if_missing (nginx::source line 48)
[Wed, 07 Nov 2012 20:14:32 +0000] DEBUG: remote_file[/var/chef/cache/nginx-1.0.4.tar.gz] exists at /var/chef/cache/nginx-1.0.4.tar.gz taking no action.
[Wed, 07 Nov 2012 20:14:32 +0000] INFO: Processing bash[compile_nginx_source] action run (nginx::source line 53)
[Wed, 07 Nov 2012 20:14:32 +0000] DEBUG: bash[compile_nginx_source] sentinel file /opt/nginx-1.0.4/sbin/nginx exists - nothing to do
<...snip...>
[Wed, 07 Nov 2012 20:14:47 +0000] INFO: bash[compile_nginx_source] sending restart action to service[nginx] (delayed)
[Wed, 07 Nov 2012 20:14:47 +0000] INFO: Processing service[nginx] action restart (nginx::source line 98)

The bash resource is defined as:

bash "compile_nginx_source" do
cwd Chef::Config[:file_cache_path]
code <<-EOH
tar zxf nginx-#{nginx_version}.tar.gz
cd nginx-#{nginx_version} && ./configure #{configure_flags}
make && make install
EOH
creates node[:nginx][:src_binary]
end

This only affects one out of 4 nodes we're running this cookbook on...the other 3 correctly notice the binary is present and do not run the restart. The client is 10.14.2

I've tried removing the compiled nginx directory and clearing out the cached .tgz of the source to see if a clean run fixes it, but no dice. I'm really befuddled why Chef Client clearly declares no action is necessary and still a restart is triggered on this node. Any help/advice is greatly appreciated.

-J
What's in the "< snip >"? Lots of output? Do you have a second resource with that name that is running for some reason?

--
Daniel DeLeo