system: Implement remote system reboot via Sysrepo
The ietf-system model [1] models an RPC (ietf-system:system-restart)
which causes system restart.
The restart is done simply by invoking `systemctl reboot` command.
Originally, I wanted just to call systemd's Reboot method over its D-Bus
API [2], however, it does not shutdown services and just goes straight
into the reboot process. The version from logind, that can do this, is
not available on our boxes.
[1] https://tools.ietf.org/html/rfc7317
[2] https://www.freedesktop.org/wiki/Software/systemd/dbus/
Change-Id: I7d690a11402eaf408d9dce04d3ac0ef9006bcdb8
diff --git a/src/system/IETFSystem.h b/src/system/IETFSystem.h
index 4367369..c9ec195 100644
--- a/src/system/IETFSystem.h
+++ b/src/system/IETFSystem.h
@@ -14,10 +14,11 @@
class IETFSystem {
public:
- explicit IETFSystem(std::shared_ptr<::sysrepo::Session> srSession, const std::filesystem::path& osRelease);
+ IETFSystem(std::shared_ptr<::sysrepo::Session> srSession, const std::filesystem::path& osRelease);
private:
std::shared_ptr<::sysrepo::Session> m_srSession;
+ std::shared_ptr<::sysrepo::Subscribe> m_srSubscribe;
velia::Log m_log;
};
}