diff -r 68d2a4f90c1f lib/plugins/stonith/external.c
--- a/lib/plugins/stonith/external.c	Thu Dec 10 14:58:34 2009 +0900
+++ b/lib/plugins/stonith/external.c	Thu Dec 10 17:00:01 2009 +0900
@@ -116,7 +116,7 @@
 /* Run the command with op and return the exit status + the output 
  * (NULL -> discard output) */
 static int external_run_cmd(struct pluginDevice *sd, const char *op, 
-		char **output);
+		char **output, gboolean isbufferd);
 /* Just free up the configuration and the memory, if any */
 static void external_unconfig(struct pluginDevice *sd);
 
@@ -140,7 +140,7 @@
 		return(S_OOPS);
 	}
 	
-	rc = external_run_cmd(sd, op, &output);
+	rc = external_run_cmd(sd, op, &output, TRUE);
 	if (rc != 0) {
 		LOG(PIL_CRIT, "%s: '%s %s' failed with rc %d",
 			__FUNCTION__, sd->subplugin, op, rc);
@@ -197,7 +197,7 @@
 		return(NULL);
 	}
 
-	rc = external_run_cmd(sd, op, &output);
+	rc = external_run_cmd(sd, op, &output, TRUE);
 	if (rc != 0) {
 		LOG(PIL_CRIT, "%s: '%s %s' failed with rc %d",
 			__FUNCTION__, sd->subplugin, op, rc);
@@ -316,7 +316,7 @@
 		return S_OOPS;
 	}
 	
-	rc = external_run_cmd(sd, args1and2, &output);
+	rc = external_run_cmd(sd, args1and2, &output, FALSE);
 	FREE(args1and2);
 	if (rc != 0) {
 		LOG(PIL_CRIT, "%s: '%s %s' for host %s failed with rc %d",
@@ -491,7 +491,7 @@
 		char	*output = NULL, *pch;
 		int	namecount;
 
-		rc = external_run_cmd(sd, op, &output);
+		rc = external_run_cmd(sd, op, &output, TRUE);
 		if (rc != 0) {
 			LOG(PIL_CRIT, "%s: '%s %s' failed with rc %d",
 				__FUNCTION__, sd->subplugin, op, rc);
@@ -607,7 +607,7 @@
 			return NULL;
 	}
 
-	rc = external_run_cmd(sd, op, &ret);
+	rc = external_run_cmd(sd, op, &ret, TRUE);
 	if (rc != 0) {
 		LOG(PIL_CRIT, "%s: '%s %s' failed with rc %d",
 			__FUNCTION__, sd->subplugin, op, rc);
@@ -711,7 +711,7 @@
 /* Run the command with op as command line argument(s) and return the exit
  * status + the output */
 static int 
-external_run_cmd(struct pluginDevice *sd, const char *op, char **output)
+external_run_cmd(struct pluginDevice *sd, const char *op, char **output, gboolean isbufferd)
 {
 	const int		BUFF_LEN=4096;
 	char			buff[BUFF_LEN];
@@ -722,6 +722,7 @@
 	char			cmd[FILENAME_MAX+64];
 	struct stat		buf;
 	int			slen;
+	gboolean		tosleep;
 
 	rc = snprintf(cmd, FILENAME_MAX, "%s/%s", 
 		STONITH_EXT_PLUGINDIR, sd->subplugin);
@@ -773,17 +774,32 @@
 	slen=0;
 	data = MALLOC(1);
 	while(data && !feof(file)) {
-		data[slen]=EOS;
-		read_len = fread(buff, 1, BUFF_LEN, file);
-		if (read_len > 0) {
-			data=REALLOC(data, slen+read_len+1);
-			if (data == NULL) {
-				break;
+		tosleep = TRUE;
+
+		if (isbufferd){
+			data[slen]=EOS;
+			read_len = fread(buff, 1, BUFF_LEN, file);
+			if (read_len > 0) {
+				data=REALLOC(data, slen+read_len+1);
+				if (data == NULL) {
+					break;
+				}
+				memcpy(data + slen, buff, read_len);
+				slen += read_len;
+				data[slen] = EOS;
+				tosleep = FALSE;
 			}
-			memcpy(data+slen, buff, read_len);
-			slen += read_len;
-			data[slen] = EOS;
 		}else{
+			if (fgets(buff, BUFF_LEN, file)) {	
+				LOG(PIL_INFO, "%s: '%s' output: %s", __FUNCTION__, cmd, buff);
+				if (Debug && data) {
+					LOG(PIL_DEBUG, "%s: '%s' output: %s", __FUNCTION__, cmd, buff);
+				}
+				tosleep = FALSE;
+			}
+		}
+		
+		if (tosleep) {
 			sleep(1);
 		}
 	}
@@ -797,11 +813,11 @@
 	if (rc != 0) {
 		LOG(PIL_INFO, "%s: Calling '%s' returned %d", __FUNCTION__, cmd, rc);
 	}
-	if (Debug && data) {
+	if (Debug && data && isbufferd) {
 		LOG(PIL_DEBUG, "%s: '%s' output: %s", __FUNCTION__, cmd, data);
 	}
 
-	if (output) {
+	if (output && isbufferd) {
 		*output = data;
 	} else {
 		FREE(data);
