Browse Source

wd: default to not using a watchdog

Signed-off-by: Ferenc Wágner <wferi@debian.org>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
Ferenc Wágner 8 years ago
parent
commit
b7b318b86f
2 changed files with 8 additions and 5 deletions
  1. 6 2
      exec/wd.c
  2. 2 3
      man/corosync.conf.5

+ 6 - 2
exec/wd.c

@@ -89,7 +89,7 @@ static uint64_t tickle_timeout = (WD_DEFAULT_TIMEOUT_MS / 2);
 static int dog = -1;
 static corosync_timer_handle_t wd_timer;
 static int watchdog_ok = 1;
-static char *watchdog_device = "/dev/watchdog";
+static char *watchdog_device = NULL;
 
 struct corosync_service_engine wd_service_engine = {
 	.name			= "corosync watchdog service",
@@ -635,7 +635,7 @@ static int setup_watchdog(void)
 	ENTER();
 
 	if (icmap_get_string("resources.watchdog_device", &str) == CS_OK) {
-		if (strcmp (str, "off") == 0) {
+		if (str[0] == 0 || strcmp (str, "off") == 0) {
 			log_printf (LOGSYS_LEVEL_WARNING, "Watchdog disabled by configuration");
 			free(str);
 			dog = -1;
@@ -643,6 +643,10 @@ static int setup_watchdog(void)
 		} else {
 			watchdog_device = str;
 		}
+	} else {
+		log_printf (LOGSYS_LEVEL_WARNING, "Watchdog not enabled by configuration");
+		dog = -1;
+		return -1;
 	}
 
 	if (access (watchdog_device, W_OK) != 0) {

+ 2 - 3
man/corosync.conf.5

@@ -652,9 +652,8 @@ directive it is possible to specify options for resources.
 Possible option is:
 .TP
 watchdog_device
-Watchdog device to use.
-The default value is /dev/watchdog.
-The special value "off" disables watchdog usage.
+Watchdog device to use, for example /dev/watchdog.
+If unset, empty or "off", no watchdog is used.
 .IP
 In a cluster with properly configured power fencing a watchdog
 provides no additional value.  On the other hand, slow watchdog