diff options
| author | Patrick Venture <venture@google.com> | 2019-08-05 09:35:26 -0700 |
|---|---|---|
| committer | Patrick Venture <venture@google.com> | 2019-08-05 09:37:38 -0700 |
| commit | ec105dda9ce4e764f28cfa91a34e2d9fa9730eaf (patch) | |
| tree | c3abbf781297537952723db5fda0976534bb1cac /bmc | |
| parent | cf0e5de3f838898861208f8e2743aaf5221a5d5e (diff) | |
| download | phosphor-ipmi-flash-ec105dda9ce4e764f28cfa91a34e2d9fa9730eaf.tar.gz phosphor-ipmi-flash-ec105dda9ce4e764f28cfa91a34e2d9fa9730eaf.zip | |
bugfix: bmc: update service requires mode
Systemd startunit requires a job-mode. Default it to "replace." In a
later patchset, the update systemd and verify system will collapse into
one object, but this fix applies to the current implementation.
Signed-off-by: Patrick Venture <venture@google.com>
Change-Id: Ia6465abac9979501ea7149933394d8c452b2f315
Diffstat (limited to 'bmc')
| -rw-r--r-- | bmc/buildjson.cpp | 2 | ||||
| -rw-r--r-- | bmc/update_systemd.cpp | 6 | ||||
| -rw-r--r-- | bmc/update_systemd.hpp | 3 |
3 files changed, 3 insertions, 8 deletions
diff --git a/bmc/buildjson.cpp b/bmc/buildjson.cpp index a359add..aec9a09 100644 --- a/bmc/buildjson.cpp +++ b/bmc/buildjson.cpp @@ -113,7 +113,7 @@ std::vector<HandlerConfig> buildHandlerFromJson(const nlohmann::json& data) { const auto& unit = update.at("unit"); pack->update = SystemdUpdateMechanism::CreateSystemdUpdate( - sdbusplus::bus::new_default(), unit); + sdbusplus::bus::new_default(), unit, "replace"); } else { diff --git a/bmc/update_systemd.cpp b/bmc/update_systemd.cpp index d8f2329..92c97c8 100644 --- a/bmc/update_systemd.cpp +++ b/bmc/update_systemd.cpp @@ -45,11 +45,7 @@ bool SystemdUpdateMechanism::trigger() auto method = bus.new_method_call(systemdService, systemdRoot, systemdInterface, "StartUnit"); method.append(target); - - if (!mode.empty()) - { - method.append(mode); - } + method.append(mode); try { diff --git a/bmc/update_systemd.hpp b/bmc/update_systemd.hpp index 15d616f..fe0ab33 100644 --- a/bmc/update_systemd.hpp +++ b/bmc/update_systemd.hpp @@ -17,8 +17,7 @@ class SystemdUpdateMechanism : public TriggerableActionInterface public: static std::unique_ptr<TriggerableActionInterface> CreateSystemdUpdate(sdbusplus::bus::bus&& bus, - const std::string& target, - const std::string& mode = ""); + const std::string& target, const std::string& mode); SystemdUpdateMechanism(sdbusplus::bus::bus&& bus, const std::string& target, const std::string& mode) : |

