Adoptable Cookbooks List

Looking for a cookbook to adopt? You can now see a list of cookbooks available for adoption!
List of Adoptable Cookbooks

Supermarket Belongs to the Community

Supermarket belongs to the community. While Chef has the responsibility to keep it running and be stewards of its functionality, what it does and how it works is driven by the community. The chef/supermarket repository will continue to be where development of the Supermarket application takes place. Come be part of shaping the direction of Supermarket by opening issues and pull requests or by joining us on the Chef Mailing List.

Select Badges

Select Supported Platforms

RSS

fb_tmpclean (1) Versions 0.0.1

Install/Configures tmp file cleaning

Berkshelf
Policyfile
Knife
cookbook 'fb_tmpclean', '~> 0.0.1'
cookbook 'fb_tmpclean', '~> 0.0.1', :supermarket
knife supermarket install fb_tmpclean
knife supermarket download fb_tmpclean
README
Dependencies
Quality 50%

fb_tmpclean Cookbook

This cookbook allows you to customize how you would like directories cleaned to ensure more appropriate filesystem cleanup.

Requirements

Supports three platforms: * CentOS = tmpwatch * Debian = tmpreaper * macOS = tmpreaper

Attributes

  • node['fb_tmpclean']['default_files']
  • node['fb_tmpclean']['directories']
  • node['fb_tmpclean']['excludes']
  • node['fb_tmpclean']['timestamptype']
  • node['fb_tmpclean']['extra_lines']

Usage

Anywhere, in any cookbook, you can set tmpclean to be tuned to the needs of a tier or server. By default, tmpclean takes time in hours, or you may suffix with m (minutes), h (hours), or d (days).

The attributes are used like this:

default_files

This is the lifetime of the files that are cleaned up by default by the respective packages. It defaults to 240, and the files covered are:

  • CentOS Includes (if exists) /var/{cache/man,catman}/{cat?,X11R6/cat?,local/cat?}

directories

This is a hash of directories you'd like cleaned and the lifetime of files.

Add other entries as you need.

excludes

This is an array of files to exclude from cleaning in all directories listed in node['fb_tmpclean']['directories'].

Both tmpwatch (CentOS) and tmpreaper (Debian, macOS) use shell patterns for excludes. However, these "shell patterns" differ subtly on the two platforms, so test carefully. The defaults for excludes change per platform.

When the cron job is built, each of the excludes is appended to the list of directories with a slash appended to the directory name. An exclusion of /tmp/file with a directory of /tmp will result in a -X of /tmp//tmp/file. The way the options are constructed, each exclusion is appended to each directory to create absolute paths.

for dir in directories:
    for exclusion in exclusions:
        print '-X ' + dir + '/' + exclusions

timestamptype

By default we tell tmpwatch (on CentOS) and tmpreaper (on Debian and macOS) to use mtime, but you can change this by setting node['fb_tmpclean']['timestamptype'] to atime.

To ensure that empty directories get removed, we still force tmpreaper to use mtime on directories even when using atime for files, since directories' atime get updated when their contents get tested.

extra_lines

An array of extra lines that will be put, verbatim, into the config file.

Examples:

node.default['fb_tmpclean']['directories']['/home/zuck'] = 1
node.default['fb_tmpclean']['extra_lines'] << "LINE"

remove_special_files

A boolean value which determines whether or not tmpwatch will remove special filetypes.

Defaults:

  • default_files = 240 hours
  • excludes are set per-platform based on the tool's defaults. See `attributes/default.rb'
  • remove_special_files defaults to false to avoid a default case that may be dangerous

Dependent cookbooks

fb_helpers >= 0.0.0

Contingent cookbooks

There are no cookbooks that are contingent upon this one.

Collaborator Number Metric
            

0.0.1 failed this metric

Failure: Cookbook has 0 collaborators. A cookbook must have at least 2 collaborators to pass this metric.

Contributing File Metric
            

0.0.1 passed this metric

Foodcritic Metric
            

0.0.1 failed this metric

FC064: Ensure issues_url is set in metadata: fb_tmpclean/metadata.rb:1
FC066: Ensure chef_version is set in metadata: fb_tmpclean/metadata.rb:1
Run with Foodcritic Version 14.0.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any

No Binaries Metric
            

0.0.1 passed this metric

Publish Metric
            

0.0.1 passed this metric

Supported Platforms Metric
            

0.0.1 passed this metric

Testing File Metric
            

0.0.1 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
            

0.0.1 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 include a tag that matches this cookbook version number