Skip to content
This repository has been archived by the owner on Jan 23, 2019. It is now read-only.

install-monit-binary gets STDERR: cp: cannot create regular file `/usr/bin/monit': Text file busy #60

Closed
joelhandwell opened this issue Dec 11, 2014 · 3 comments

Comments

@joelhandwell
Copy link

Hello, I got following error while running chef-client which includes install-monit-binary in runlist:
This error appears on chef-client run after "first run" which is successful.
Looks like /usr/bin/monit is not available during command "cd /var/chef/cache && tar zxvf monit-5.10.tar.gz && cd monit-5.10 && cp bin/monit /usr/bin/monit" because monit service is running.
Following is the error:

Recipe: monit::install_binary
   execute[install-monit-binary] action run

Error executing action `run` on resource 'execute[install-monit-binary]'


Mixlib::ShellOut::ShellCommandFailed

Expected process to exit with [0], but received '1'
---- Begin output of cd /var/chef/cache &&   tar zxvf monit-5.10.tar.gz &&   cd monit-5.10 &&   cp bin/monit /usr/bin/monit ----
STDOUT: monit-5.10/
monit-5.10/bin/
monit-5.10/bin/monit
monit-5.10/COPYING
monit-5.10/conf/
monit-5.10/conf/monitrc
monit-5.10/man/
monit-5.10/man/man1/
monit-5.10/man/man1/monit.1
STDERR: cp: cannot create regular file `/usr/bin/monit': Text file busy
---- End output of cd /var/chef/cache &&   tar zxvf monit-5.10.tar.gz &&   cd monit-5.10 &&   cp bin/monit /usr/bin/monit ----
Ran cd /var/chef/cache &&   tar zxvf monit-5.10.tar.gz &&   cd monit-5.10 &&   cp bin/monit /usr/bin/monit returned 1


Resource Declaration:

 In /var/chef/cache/cookbooks/monit/recipes/install_binary.rb

 10: execute "install-monit-binary" do
 11:   command "cd #{Chef::Config[:file_cache_path]} && \
 12:   tar zxvf monit-#{node["monit"]["binary"]["version"]}.tar.gz && \
 13:   cd monit-#{node["monit"]["binary"]["version"]} && \
 14:   cp bin/monit #{node["monit"]["binary"]["prefix"]}/bin/monit"
 15:   action :nothing
 16: end
 17:



Compiled Resource:

 Declared in /var/chef/cache/cookbooks/monit/recipes/install_binary.rb:10:in `from_file'

execute("install-monit-binary") do
  action [:nothing]
  retries 0
  retry_delay 2
  guard_interpreter :default
  command "cd /var/chef/cache &&   tar zxvf monit-5.10.tar.gz &&   cd monit-5.10 &&   cp bin/monit /usr/bin/monit"
  backup 5
  returns 0
  cookbook_name "monit"
  recipe_name "install_binary"
end



Recipe: monit::default
  * service[monit] action reload
    - reload service service[monit]


Running handlers:
[2014-12-11T14:09:31-05:00] ERROR: Running exception handlers
Running handlers complete

[2014-12-11T14:09:31-05:00] ERROR: Exception handlers complete
[2014-12-11T14:09:31-05:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
Chef Client failed. 136 resources updated in 497.362269175 seconds
[2014-12-11T14:09:31-05:00] ERROR: execute[install-monit-binary] (monit::install_binary line 10) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of cd /var/chef/cache &&   tar zxvf monit-5.10.tar.gz &&   cd monit-5.10 &&   cp bin/monit /usr/bin/monit ----
STDOUT: monit-5.10/
monit-5.10/bin/
monit-5.10/bin/monit
monit-5.10/COPYING
monit-5.10/conf/
monit-5.10/conf/monitrc
monit-5.10/man/
monit-5.10/man/man1/
monit-5.10/man/man1/monit.1
STDERR: cp: cannot create regular file `/usr/bin/monit': Text file busy
---- End output of cd /var/chef/cache &&   tar zxvf monit-5.10.tar.gz &&   cd monit-5.10 &&   cp bin/monit /usr/bin/monit ----
Ran cd /var/chef/cache &&   tar zxvf monit-5.10.tar.gz &&   cd monit-5.10 &&   cp bin/monit /usr/bin/monit returned 1
[2014-12-11T14:09:32-05:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
@ocxo
Copy link

ocxo commented Dec 29, 2014

Also seeing this issue when trying to upgrade (see #61)

@phlipper
Copy link
Owner

phlipper commented May 2, 2015

This is resolved via #71

@phlipper phlipper closed this as completed May 2, 2015
@iiro
Copy link

iiro commented Nov 4, 2015

Excellent.

@phlipper any releases coming at some point...?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants