Chef cron provider creates multiple crontab entries -


We are running chef 11.4.4 with non-omnibus installs (this is installed as a gem). In one of our cookbooks, we use cron providers:

  checksum = digest :: MD5 HexDogest (node ​​['FDDN'] || 'Unknown-hostname') sleep_time = checksum.to_s .hex% node ['custom' command '] [' esplay ']. Two_I cron "custom_command" user "custom_user" hour 1 minute 0 command "/ bin / sleep # {sleep_time}; /home/custom_user/custom_command.sh" end   

It appears to be about 0.01% of the time multiple cron entries. On the affected server, we receive the following output from crontab -u custom_user -l :

  # Name of the chef: custom_command 0 0 * * * / bin / sleep 7035 ; /home/custom_user/custom_command.sh # Chef name: custom_command 0 0 * * * / bin / sleep 7035; /home/custom_user/custom_command.sh   

Running chef-client does not modify crontab. But editing the cronat and removing both entries and running the chef-client again will fix the problem. Then the crontab -u custom_user -l output looks (correct):

  #The name of the chef: custom_command 0 0 * * * / bin / sleep 7035; /home/custom_user/custom_command.sh   

This problem appears to pop up at random - we currently have to fix approximately 1 server per day. So it seems like any kind of race issue.

Has anyone else experienced this problem? I have not seen it using the cron_d provider.

It's a bug like a bug but it is possible to delete all the cronat jobs before making them possible. Ho: crontab -r -u USERNAME

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -