Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Chef client waiting to finish

When there are problems while running a recipe and the client run is hanging half way, the installed Chef client will be unusable.

You can then exit the machine, reboot, clean up chef pid files and so forth but each time the Chef client is started the following message is shown:

Chef client is running, will wait for it to finish and then run.

Chef should be able to recover from this when a reboot is performed but this is not the case.

What is the best way to recover from a client run that hangs half way? Currently I delete the VM and create a new one but that is not a real solution.

Is it possible to recover when it hangs half way?

like image 552
onknows Avatar asked Aug 18 '15 11:08

onknows


1 Answers

Stop the service if any running : sudo service chef-client stop

if the issue persists

  • find out if nay chef client process/service is running: ps aux | grep chef
  • kill the process

if the issue persists

  • look up your chef client settings under /etc/chef/client.rb and/or your etc/init.d/chef-client
  • then locate the pid_file and lockfile path
  • delete the files

if the issues persists, you might run like me a old version of chef-client you need to look in your chef cache folder

I had to delete /var/chef/cache/chef-client-running.pid

like image 115
Francois Avatar answered Sep 30 '22 08:09

Francois