cookbook 'lockrun', '~> 1.1.0', :supermarket
lockrun (6) Versions 1.1.0 Follow0
Installs lockrun executable for running cronjobs with overrun protection.
cookbook 'lockrun', '~> 1.1.0'
knife supermarket install lockrun
knife supermarket download lockrun
lockrun-cookbook
Installs the lockrun executable for running cronjobs with overrun protection.
Basic Usage
This cookbook is extremely useful when you only want to have a single process running at a time. We use this to ensure that there is only ever one Chef Client running at a time. If a process already has the lock it bails out immediately.
Instead of writing a wrapper script every time you want this functionality simply use the lockrun executable. It counts the number of open file descriptors to a lockfile on disk. ```ruby include_recipe 'lockrun::default'
sleep_time = 0 unless node['chef_client']['splay'].to_i == 0 checksum = Digest::MD5.hexdigest(node['fqdn'] || 'unknown-hostname') sleep_time = checksum.to_s.hex % node['chef_client']['splay'].to_i end
lockrun_cron 'chef-client' do command "/bin/sleep #{sleep_time}; chef-client > /dev/null 2>&1" cron_options(minute: '0', hour: '', weekday: '') end ```
Out of the box the following platforms are certified to work and are tested using our [Test Kitchen][8] configuration. Additional platforms may work, but your mileage may vary. - CentOS (RHEL) 5.8, 6.6, 7.1 - Ubuntu 12.04, 14.04
Dependent cookbooks
poise ~> 2.0 |
libarchive ~> 0.6 |
build-essential >= 0.0.0 |
Contingent cookbooks
There are no cookbooks that are contingent upon this one.
Collaborator Number Metric
1.1.0 passed this metric
Contributing File Metric
1.1.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Foodcritic Metric
1.1.0 failed this metric
FC122: Use the build_essential resource instead of the recipe: lockrun/recipes/default.rb:30
Run with Foodcritic Version 14.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
No Binaries Metric
1.1.0 passed this metric
Publish Metric
1.1.0 passed this metric
Supported Platforms Metric
1.1.0 passed this metric
Testing File Metric
1.1.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
1.1.0 passed this metric
1.1.0 passed this metric
1.1.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Foodcritic Metric
1.1.0 failed this metric
FC122: Use the build_essential resource instead of the recipe: lockrun/recipes/default.rb:30
Run with Foodcritic Version 14.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
No Binaries Metric
1.1.0 passed this metric
Publish Metric
1.1.0 passed this metric
Supported Platforms Metric
1.1.0 passed this metric
Testing File Metric
1.1.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
1.1.0 passed this metric
1.1.0 failed this metric
Run with Foodcritic Version 14.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
1.1.0 passed this metric
Publish Metric
1.1.0 passed this metric
Supported Platforms Metric
1.1.0 passed this metric
Testing File Metric
1.1.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
1.1.0 passed this metric
1.1.0 passed this metric
1.1.0 passed this metric
Testing File Metric
1.1.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
1.1.0 passed this metric
1.1.0 failed this metric
1.1.0 passed this metric