utils: restart: Always restart service

If the service has hit its reset limit in systemd, calling RestartUnit
on the service will do nothing. This ensures that the service will try
and restart at least once after a configuration change, regardless of
whether or not it has failed in the past.

Change-Id: I28962fc4ef9da641d1d19b8e09450e40d76e9c27
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/phosphor-rsyslog-config/utils.hpp b/phosphor-rsyslog-config/utils.hpp
index 017a439..30799cd 100644
--- a/phosphor-rsyslog-config/utils.hpp
+++ b/phosphor-rsyslog-config/utils.hpp
@@ -10,14 +10,27 @@
 {
 
 /** @brief Restart rsyslog's systemd unit
+ *         Ensures that it is restarted even if the start limit was
+ *         hit in systemd.
  */
 void restart()
 {
     auto bus = sdbusplus::bus::new_default();
-    auto method = bus.new_method_call(SYSTEMD_BUSNAME, SYSTEMD_PATH,
-                                      SYSTEMD_INTERFACE, "RestartUnit");
-    method.append("rsyslog.service", "replace");
-    bus.call_noreply(method);
+    constexpr char service[] = "rsyslog.service";
+
+    {
+        auto method = bus.new_method_call(SYSTEMD_BUSNAME, SYSTEMD_PATH,
+                                          SYSTEMD_INTERFACE, "ResetFailedUnit");
+        method.append(service);
+        bus.call_noreply(method);
+    }
+
+    {
+        auto method = bus.new_method_call(SYSTEMD_BUSNAME, SYSTEMD_PATH,
+                                          SYSTEMD_INTERFACE, "RestartUnit");
+        method.append(service);
+        bus.call_noreply(method);
+    }
 }
 
 } // namespace rsyslog_utils