diff options
author | Matthias Schiffer <matthias@gamezock.de> | 2008-09-25 13:36:02 +0200 |
---|---|---|
committer | Matthias Schiffer <matthias@gamezock.de> | 2008-09-25 13:36:02 +0200 |
commit | af0f84058d322d68cbbff98ef272dd2bcd0f692c (patch) | |
tree | 23b1fb83790f2100ae2d16eb0af71122e88cba0a /src/Common/Backends | |
parent | 3a8e13c8ef66a4fdb06b2051bd7ab95ca24cc81c (diff) | |
download | mad-af0f84058d322d68cbbff98ef272dd2bcd0f692c.tar mad-af0f84058d322d68cbbff98ef272dd2bcd0f692c.zip |
Daemon-Host kann jetzt heruntergefahren und neu gestartet werden
Diffstat (limited to 'src/Common/Backends')
-rw-r--r-- | src/Common/Backends/SystemBackendPosix.h | 14 |
1 files changed, 13 insertions, 1 deletions
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<pid_t, sigc::slot<void, int> > processes; @@ -46,9 +46,21 @@ class SystemBackendPosix { setChildHandler(); } + protected: + virtual bool doShutdown() {return exec(sigc::slot<void, int>(), "/sbin/halt");} + virtual bool doReboot() {return exec(sigc::slot<void, int>(), "/sbin/reboot");} + public: ~SystemBackendPosix(); + static void registerBackend() { + SystemBackend::registerBackend(&backend); + } + + static void unregisterBackend() { + SystemBackend::unregisterBackend(&backend); + } + static bool exec(sigc::slot<void, int> resultHandler, const std::string &filename, const std::vector<std::string> &argv = std::vector<std::string>(), const std::vector<std::string> &env = std::vector<std::string>()); }; |