diff options
author | Christian Mueller <christian.ei.mueller@bmw.de> | 2012-05-21 19:00:35 +0200 |
---|---|---|
committer | christian mueller <christian.ei.mueller@bmw.de> | 2012-05-24 13:40:23 +0200 |
commit | 3f65139b2825e654dd0cc36d1cee055b7ac959d9 (patch) | |
tree | f9baf9833b8da138428c7ee295f6af7953c7085f /AudioManagerDaemon/src/main.cpp | |
parent | a572fc87a811563f62b88116de699f803915383e (diff) | |
download | audiomanager-3f65139b2825e654dd0cc36d1cee055b7ac959d9.tar.gz |
* [GAM-24] Watchdog concept for the AudioManager. This patch introduces the watchdog functionality of the AudioManager. The function is based on the systemd watchdog functionality. The desired time intervals for checking the watchdog can be tweaked by the unit file for systemd. A sample unit file is added to the subdirectory cmake. Via Cmake build option, the watchdog functionality can be switched off.
If the development package from systemd is available it will use the lib that comes with it. If not, the default handler will be compiled along with the audiomanager and this one will be used.
Signed-off-by: Christian Mueller <christian.ei.mueller@bmw.de>
Diffstat (limited to 'AudioManagerDaemon/src/main.cpp')
-rwxr-xr-x[-rw-r--r--] | AudioManagerDaemon/src/main.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/AudioManagerDaemon/src/main.cpp b/AudioManagerDaemon/src/main.cpp index ad908ec..a50fe03 100644..100755 --- a/AudioManagerDaemon/src/main.cpp +++ b/AudioManagerDaemon/src/main.cpp @@ -56,6 +56,7 @@ #include "CAmCommandReceiver.h" #include "CAmControlReceiver.h" #include "CAmDatabaseObserver.h" +#include "CAmWatchdog.h" #include "shared/CAmDltWrapper.h" #include "shared/CAmSocketHandler.h" @@ -63,7 +64,6 @@ using namespace am; DLT_DECLARE_CONTEXT(AudioManager) - const char* USAGE_DESCRIPTION = "Usage:\tAudioManagerDaemon [options]\n" "options:\t\n" "\t-h: print this message\t\n" @@ -279,6 +279,10 @@ void mainProgram() CAmDbusWrapper iDBusWrapper(&iSocketHandler,dbusWrapperType); #endif /*WITH_DBUS_WRAPPER */ +#ifdef WITH_SYSTEMD_WATCHDOG + CAmWatchdog iWatchdog(&iSocketHandler); +#endif /*WITH_SYSTEMD_WATCHDOG*/ + CAmDatabaseHandler iDatabaseHandler(databasePath); CAmRoutingSender iRoutingSender(listRoutingPluginDirs); CAmCommandSender iCommandSender(listCommandPluginDirs); @@ -312,6 +316,10 @@ void mainProgram() //when the routingInterface is done, all plugins are loaded: iControlSender.setControllerReady(); +#ifdef WITH_SYSTEMD_WATCHDOG + iWatchdog.startWatchdog(); +#endif /*WITH_SYSTEMD_WATCHDOG*/ + //start the mainloop here.... iSocketHandler.start_listenting(); @@ -323,7 +331,7 @@ void mainProgram() * @param argv * @return */ -int main(int argc, char *argv[]) +int main(int argc, char *argv[], char** envp) { listCommandPluginDirs.push_back(std::string(DEFAULT_PLUGIN_COMMAND_DIR)); listRoutingPluginDirs.push_back(std::string(DEFAULT_PLUGIN_ROUTING_DIR)); |