From af0f84058d322d68cbbff98ef272dd2bcd0f692c Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 25 Sep 2008 13:36:02 +0200 Subject: Daemon-Host kann jetzt heruntergefahren und neu gestartet werden --- src/Common/Backends/SystemBackendPosix.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/Common/Backends') diff --git a/src/Common/Backends/SystemBackendPosix.h b/src/Common/Backends/SystemBackendPosix.h index aa2b9be..9efd59f 100644 --- a/src/Common/Backends/SystemBackendPosix.h +++ b/src/Common/Backends/SystemBackendPosix.h @@ -33,7 +33,7 @@ namespace Mad { namespace Common { namespace Backends { -class SystemBackendPosix { +class SystemBackendPosix : public SystemBackend { private: static SystemBackendPosix backend; static std::map > processes; @@ -46,9 +46,21 @@ class SystemBackendPosix { setChildHandler(); } + protected: + virtual bool doShutdown() {return exec(sigc::slot(), "/sbin/halt");} + virtual bool doReboot() {return exec(sigc::slot(), "/sbin/reboot");} + public: ~SystemBackendPosix(); + static void registerBackend() { + SystemBackend::registerBackend(&backend); + } + + static void unregisterBackend() { + SystemBackend::unregisterBackend(&backend); + } + static bool exec(sigc::slot resultHandler, const std::string &filename, const std::vector &argv = std::vector(), const std::vector &env = std::vector()); }; -- cgit v1.2.3