Chef Client Local Mode command repeted infinitely

Hi, there.
I have done Chef Client Local Mode.
Execute command is
sudo chef-client -z -j xxx.sample.com.json -i ~/.ssh/my.pem
It success to End of my recipes.
But command don't stop.
It repeat oneself again.

What is my wrong?
Do you think to resolve idea?

My environment

OS Ubuntu 14.04.5 LTS
Chef Client 12.15.19
ruby 2.3.1p112

My logs

Starting Chef Client, version 12.15.19
resolving cookbooks for run list: ["chef-myproject"]
Synchronizing Cookbooks:

  • acl (0.1.0)
  • chef-myproject (0.1.0)
  • ark (2.2.1)
  • apt (2.9.2)
  • ubuntu (2.0.0)
  • build-essential (2.4.0)
  • git (5.0.1)
  • timezone-ii (0.2.0)
  • vim (2.0.2)
  • mysql (5.6.3)
  • database (6.1.1)
  • rbenv (1.7.1)
  • unicorn-ng (2.0.1)
  • nginx (2.7.6)
  • conf (0.1.0)
  • datadog (2.7.0)
  • windows (2.0.2)
  • seven_zip (2.0.2)
  • 7-zip (1.0.2)
  • dmg (3.0.0)
  • yum-epel (0.7.1)
  • yum-mysql-community (2.0.3)
  • postgresql (5.1.0)
  • ohai (2.1.0)
  • bluepill (2.4.3)
  • runit (1.8.0)
  • chef_handler (1.4.0)
  • yum (4.1.0)
  • compat_resource (12.16.3)
  • openssl (6.0.0)
  • rsyslog (5.0.1)
  • packagecloud (0.2.5)
    Installing Cookbook Gems:
    Compiling Cookbooks...

[Recipe logs]

Running handlers:
Running handlers complete

Deprecated features used!

[Deprecated logs]

Chef Client finished, 18/132 resources updated in 19 seconds

Starting Chef Client, version 12.15.19
resolving cookbooks for run list: ["chef-myproject"]
Synchronizing Cookbooks:

[Above same logs]

1 Like

The -i argument for chef-client isn’t for a pem key; it’s for the
interval at which chef-client is to re-run. Also, chef-client runs
locally, so no ssh key is needed. If you remove that part of your command,
you should be good.

1 Like

ameir, Thank you for your answer.
My knowledge of Chef Client Local Mode is little.
I’m OK about a pem key don’t need for the local mode.
Thank you so much.