English 中文(简体)
Chef - Chef-Client as Daemon
  • 时间:2024-11-03

Chef - Chef-Cpent as Daemon


Previous Page Next Page  

Running Chef-Cpent as daemon helps in knowing the state of all the nodes at any point of time. This help in running the Chef-Cpent at any point of time.

Pre-requisites

The node should be registered with Chef server and it should be running Chef-Cpent without any error.

Chef-Cpent in Daemon Mode

Start Chef-Cpent in daemon mode, running every 30 minutes.

user@server:~$ sudo chef-cpent -i 1800 

In the above code, – i enables to run the Chef-Cpent in daemon mode on the required node and 1800 seconds define that the Chef-Cpent daemon should run in every 30 minutes.

Vapdating Daemon Run

Vapdate that the Chef-Cpent is running as a daemon.

user@server:~$ ps auxw | grep chef-cpent 

The above command will grep the running daemon process of Chef-Cpent.

Other Ways

Instead of running Chef-Cpent as a daemon, we can run the same as a cron job.

user@server:~$ subl /etc/cron.d/chef_cpent 
PATH=/usr/local/bin:/usr/bin:/bin 
# m h dom mon dow user command 
*/15 * * * * root chef-cpent -l warn | grep -v  retrying [1234]/5 in  

The above cron job will run after every 15 minutes.

Advertisements