Este contenido no está disponible en el idioma seleccionado.
24.4.7. Monitoring Files and Directories with gamin
Starting with Red Hat Enterprise Linux 6.8, the GLib system library uses gamin for monitoring of files and directories, and detection of their modifications on NFS file systems. By default, gamin uses polling for NFS file systems instead of
inotify
. Changes on other file systems are monitored by the inotify monitor that is implemented in GLib directly.
As a subset of the File Alteration Monitor (FAM) system, gamin re-implements the FAM specification with the inotify Linux kernel subsystem. It is a GNOME project, but without any GNOME dependencies. Both glib2 and gamin packages are installed by default.
By default, gamin works without the need of any configuration and it reverts to using polling for all paths matching
/mnt/*
or /media/*
on Linux. Users can override or extend these settings by modifying the content of one of the following configuration files:
/etc/gamin/gaminrc
$HOME/.gaminrc
/etc/gamin/mandatory_gaminrc
The configuration file accepts only the following commands:
Commands accepted by the configuration file
- notify
- To express that kernel monitoring should be used for matching paths.
- poll
- To express that polling should be used for matching paths.
- fsset
- To control what notification method is used on a filesystem type.
An example of such configuration file can be seen here:
The three configuration files are loaded in this order:
/etc/gamin/gaminrc
~/.gaminrc
/etc/gamin/mandatory_gaminrc
The
/etc/gamin/mandatory_gaminrc
configuration file allows the system administrator to override any potentially dangerous preferences set by the user. When checking a path to guess whether polling or kernel notification should be used, gamin checks first the user-provided rules in their declaration order within the configuration file and then check the predefined rules. This way the first declaration for /mnt/local*
in the example override the default one for /mnt/*
.
If gamin is not configured to use the poll notifications on a particular path, it decides based on the file system the path is located on.