feat(falco): monitor events with more types for rules directory

Signed-off-by: Nitro Cao <jaycecao520@gmail.com>
This commit is contained in:
Nitro Cao
2023-12-12 10:17:02 +08:00
committed by poiana
parent 47959abfed
commit 4bfc42eb7d

View File

@@ -60,7 +60,7 @@ bool falco::app::restart_handler::start(std::string& err)
for (const auto& f : m_watched_files)
{
auto wd = inotify_add_watch(m_inotify_fd, f.c_str(), IN_CLOSE_WRITE);
auto wd = inotify_add_watch(m_inotify_fd, f.c_str(), IN_CLOSE_WRITE | IN_MOVE_SELF | IN_DELETE_SELF);
if (wd < 0)
{
err = "could not watch file: " + f;
@@ -71,7 +71,7 @@ bool falco::app::restart_handler::start(std::string& err)
for (const auto &f : m_watched_dirs)
{
auto wd = inotify_add_watch(m_inotify_fd, f.c_str(), IN_CREATE | IN_DELETE);
auto wd = inotify_add_watch(m_inotify_fd, f.c_str(), IN_CREATE | IN_DELETE | IN_MOVE);
if (wd < 0)
{
err = "could not watch directory: " + f;