| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently we get a different inotify handle for every file in the
synclist, and register all of them with sd_event. A single fd will
work and saves memory in libsystemd and the kernel, so do that instead.
This in turn allows the fileMap structure to be simplified down to a
basic map of watch descriptor / filename pairs.
Remove redundant calls to both close and inotify_rm_watch - let the
kernel do the work for us. From the inotify man page:
When all file descriptors referring to an inotify instance have been
closed (using close(2)), the underlying object and its resources are
freed for reuse by the kernel; all associated watches are auto‐
matically freed.
Change-Id: Ia63cb667cdf41c171276a0351d95347a54578f2f
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When the hostname is updated via systemd, it modifies the /etc/hostname
file in a way that triggers a IN_CLOSE_NOWRITE and IN_IGNORED signal.
* When IN_IGNORED is received, re-subscribe the file, since it means
that the inotify watch was removed.
* A subsequent IN_CLOSE_WRITE signal is received after the re-subscribe
which takes care of syncing the hostname file.
Tested: The hostname was synced when changed multiple times in a row
using the REST API.
Change-Id: I30abfcdc8b33f77adc6349d345cc957b07898018
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
|
|
|
|
|
|
|
|
| |
Update the .clang-format file.
Now includes header sorting and updating PointerAlignment.
Change-Id: I5c7690d8d83cdebe26ff3a73b90a2a8c17dd8054
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Call rsync when the subscribed file or directory is modified or
deleted. Don't create error logs as syncing is used for backup
and does not affect the system's operation. Any errors will be
logged into the journal.
Closes openbmc/openbmc#2918
Change-Id: I2671f0afd2924c15ea883d4d037c641c6e9680b4
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
|
|
Create a watch class to monitor the files and directories
specified in the synclist file.
Store the file descriptors and file names in a map to be
able to know the full path of the file that triggered the
event. The watch descriptor number does not change so it
can be a single variable.
Change-Id: I211225ddc012af85d9be39ae5d40b8258d73435d
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
|