Tmpfilesd configuration¶
The tmpfilesd files are normally available to rules as a list of TmpFilesd
objects. This combiner turns those into one set of data, and provides a
find_file()
method to search for that filename among all the files.
-
class
insights.combiners.tmpfilesd.
AllTmpFiles
(tmpfiles)[source]¶ Bases:
object
Combiner for accessing all the tmpfilesd configuration files. Configuration files can be found in three directories:
/usr/lib/tmpfiles.d
,/run/tmpfiles.d
, and/etc/tmpfiles.d
. Each directory overrides the settings in the previous directory. This combiner checks for and accounts for this behavior.-
files
¶ the set of files found in all data files.
Type: set
-
active_rules
¶ a dictionary of rules using the config file as the key
Type: dict
-
file_paths
¶ a list of the file paths for the configurations.
Type: list
-
find_file
(path)[source]¶ Find all the rules matching a given file. Uses the rules dictionary to search so duplicate files are alreayd removed.
Examples
>>> data = shared[AllTmpFiles] >>> results = data.find_file('/tmp/sap.conf') >>> len(results) 1 >>> results {'/etc/tmpfiles.d/sap.conf': {'path': '/tmp/sap.conf', 'mode': '644', 'type': 'x', 'age': None, 'gid': None, 'uid': None, 'argument': None}}
Parameters: path (str) -- path to be searched for among the rules. Returns: a dictionary of rules where the path is found using the config file path as the key. Return type: (dict)
-