Details
-
Type:
Bug
-
Status: Done
-
Priority:
High
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 3.6.1
-
Component/s: Promise type: files
-
Labels:None
Description
File integrity monitoring: CFEngine fails to inform me when a monitored file disappears.
Example:
root@tashkent:/home/atsaloli/git/documentation/examples# rm -rf /etc/example
root@tashkent:/home/atsaloli/git/documentation/examples# mkdir /etc/example
root@tashkent:/home/atsaloli/git/documentation/examples# date > /etc/example/example.conf
root@tashkent:/home/atsaloli/git/documentation/examples# cf-agent -f cd.cf
2013-06-06T20:53:26-0700 error: /example/files/'/etc/example': File '/etc/example/example.conf' was not in 'md5' database - new file found
root@tashkent:/home/atsaloli/git/documentation/examples# cf-agent -f cd.cf -K
root@tashkent:/home/atsaloli/git/documentation/examples#
root@tashkent:/home/atsaloli/git/documentation/examples# touch /etc/example/example.conf
root@tashkent:/home/atsaloli/git/documentation/examples# cf-agent -f cd.cf -K
2013-06-06T20:53:52-0700 error: Last modified time for '/etc/example/example.conf' changed 'Thu Jun 6 20:53:18 2013' -> 'Thu Jun 6 20:53:49 2013'
root@tashkent:/home/atsaloli/git/documentation/examples# date >> /etc/example/example.conf
root@tashkent:/home/atsaloli/git/documentation/examples# cf-agent -f cd.cf -K
2013-06-06T20:54:01-0700 error: Hash 'md5' for '/etc/example/example.conf' changed!
2013-06-06T20:54:01-0700 error: /example/files/'/etc/example': Updating hash for '/etc/example/example.conf' to 'MD5=8576cb25c9f78bc9ab6afd2c32203ca1'
2013-06-06T20:54:01-0700 error: Last modified time for '/etc/example/example.conf' changed 'Thu Jun 6 20:53:49 2013' -> 'Thu Jun 6 20:53:59 2013'
root@tashkent:/home/atsaloli/git/documentation/examples# rm /etc/example/example.conf
root@tashkent:/home/atsaloli/git/documentation/examples# cf-agent -f cd.cf -K
root@tashkent:/home/atsaloli/git/documentation/examples# touch /etc/example/example.conf
root@tashkent:/home/atsaloli/git/documentation/examples# cf-agent -f cd.cf -K
2013-06-06T20:54:38-0700 error: /example/files/'/etc/example': File '/etc/example/example.conf' was not in 'md5' database - new file found
2013-06-06T20:54:38-0700 error: Last modified time for '/etc/example/example.conf' changed 'Thu Jun 6 20:53:59 2013' -> 'Thu Jun 6 20:54:36 2013'
root@tashkent:/home/atsaloli/git/documentation/examples#
root@tashkent:/home/atsaloli/git/documentation/examples# cat /var/cfengine/inputs/cd.cf
<pre>
body common control
{
bundlesequence =>
;
}
########################################################
bundle agent example
{ files: "/etc/example" # Directory to monitor for changes. changes => detect_all_change, depth_search => recurse("inf"); }#########################################################
body changes detect_all_change
{ report_changes => "all"; update_hashes => "yes"; }#########################################################
body depth_search recurse(d)
{ depth => "$(d)"; }</pre>
root@tashkent:/home/atsaloli/git/documentation/examples#
This is with CFEngine Core 3.5.0b2.785288377e1aa2a1ba45426f5baff7d96f55adb0