diff options
author | Adriana Kobylak <anoo@us.ibm.com> | 2018-03-15 10:27:05 -0500 |
---|---|---|
committer | Adriana Kobylak <anoo@us.ibm.com> | 2018-04-17 11:56:22 -0500 |
commit | 5f4247f05d528345c56ca64a97d3ba571f26611d (patch) | |
tree | 97eb3606fcd501afd22f4d212e805ac2c810a33e /log_manager.hpp | |
parent | 4133daf5005177419c7d2b9ad385099a7b85feb0 (diff) | |
download | phosphor-logging-5f4247f05d528345c56ca64a97d3ba571f26611d.tar.gz phosphor-logging-5f4247f05d528345c56ca64a97d3ba571f26611d.zip |
log_manager: Create journal sync function
The Synchronize D-Bus method was a systemd patch that calls "journalctl --sync"
and will not be upstreamed to systemd. Instead duplicate the function locally
in the log_manager so that the patch can be dropped, since the systemd journal
service would not start on time if it was idle, leading to missing metadata.
Closes openbmc/openbmc#2257
Tested: While printing continously into the journal, verify that a commit
request is blocked until the journal is flushed.
Change-Id: I8248c4c2e2eaeb041f7876832b395b053409acdd
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
Diffstat (limited to 'log_manager.hpp')
-rw-r--r-- | log_manager.hpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/log_manager.hpp b/log_manager.hpp index 9339a6f..d62a25e 100644 --- a/log_manager.hpp +++ b/log_manager.hpp @@ -130,6 +130,12 @@ class Manager : public details::ServerObject<details::ManagerIface> const std::vector<std::string>& additionalData, AssociationList& objects) const; + /** @brief Synchronize unwritten journal messages to disk. + * @details This is the same implementation as the systemd command + * "journalctl --sync". + */ + void journalSync(); + /** @brief Persistent sdbusplus DBus bus connection. */ sdbusplus::bus::bus& busLog; |