You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ac...@apache.org on 2011/12/08 21:04:47 UTC
svn commit: r1212077 -
/qpid/trunk/qpid/cpp/src/qpid/cluster/WatchDogPlugin.cpp
Author: aconway
Date: Thu Dec 8 20:04:46 2011
New Revision: 1212077
URL: http://svn.apache.org/viewvc?rev=1212077&view=rev
Log:
QPID-3669: Configuration option for path to watchdog executable.
Added --watchdog-exec option to watchdog plugin to specify path to the
qpidd_watchdog executable, so it can be installed in a non-standard
place.
Modified:
qpid/trunk/qpid/cpp/src/qpid/cluster/WatchDogPlugin.cpp
Modified: qpid/trunk/qpid/cpp/src/qpid/cluster/WatchDogPlugin.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/cluster/WatchDogPlugin.cpp?rev=1212077&r1=1212076&r2=1212077&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/cluster/WatchDogPlugin.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/cluster/WatchDogPlugin.cpp Thu Dec 8 20:04:46 2011
@@ -55,8 +55,9 @@ namespace cluster {
using broker::Broker;
struct Settings {
- Settings() : interval(0) {}
+ Settings() : interval(0), watchdogExec(QPID_LIBEXEC_DIR "/qpidd_watchdog") {}
int interval;
+ std::string watchdogExec;
};
struct WatchDogOptions : public qpid::Options {
@@ -66,7 +67,9 @@ struct WatchDogOptions : public qpid::Op
addOptions()
("watchdog-interval", optValue(settings.interval, "N"),
"broker is automatically killed if it is hung for more than \
- N seconds. 0 disables watchdog.");
+ N seconds. 0 disables watchdog.")
+ ("watchdog-exec", optValue(settings.watchdogExec, ""),
+ "Path to the qpidd_watchdog executable.");
}
};
@@ -114,11 +117,10 @@ struct WatchDogPlugin : public qpid::Plu
protected:
void child() { // Child of fork
- const char* watchdog = ::getenv("QPID_WATCHDOG_EXEC"); // For use in tests
- if (!watchdog) watchdog=QPID_LIBEXEC_DIR "/qpidd_watchdog";
std::string interval = boost::lexical_cast<std::string>(settings.interval);
- ::execl(watchdog, watchdog, interval.c_str(), NULL);
- QPID_LOG(critical, "Failed to exec watchdog program " << watchdog );
+ const char* watchdogExec = settings.watchdogExec.c_str();
+ ::execl(watchdogExec, watchdogExec, interval.c_str(), NULL);
+ QPID_LOG(critical, "Failed to exec watchdog program " << watchdogExec);
::kill(::getppid(), SIGKILL);
exit(1);
}
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org