[DRBD-user] Return code 255 from datadisk

Lars Ellenberg Lars.Ellenberg at linbit.com
Tue Apr 6 20:22:22 CEST 2004

Note: "permalinks" may not be as permanent as we would like,
direct links of old sources may well be a few messages off.


/ 2004-04-06 19:58:24 +0200
\ Björn Krüger:
> Hi everyone,
> 
> I  am trying to setup my first drbd system. Everything is fine so far,
> except when I finally try to let heartbeat start the drbd0 device, I get
> an error 255 from datadisk.
> 
> Debuglog shows this:
> heartbeat: 2004/04/06_19:38:53 debug:
>	Starting /etc/ha.d/resource.d/datadisk drbd0 start

> datadisk: FATAL: no terminal
> Error during script startup. This may be an incompatible bash version

so, what bash version is it?

more likely: the user heartbeat runs as has no permission to access
/dev/console, and heartbeat has no tty, or datadisk does not inherit it.

but since this is not used for datadisk, anyways, please use below patch.

	Lars Ellenberg



Index: drbd
===================================================================
RCS file: .../drbd/scripts/drbd,v
retrieving revision 1.55
diff -u -p -r1.55 drbd
--- drbd	4 Mar 2004 07:38:18 -0000	1.55
+++ drbd	6 Apr 2004 18:18:04 -0000
@@ -168,20 +168,6 @@ else
 fi
 USLEEP="sleep 1"
 
-# QQQ thought this could be useful
-# TERMINAL=/dev/tty
-# maybe we can use $CONSOLE, which should be exported by init anyways?
-#
-for TERMINAL in /proc/$$/fd/0 /dev/tty /dev/console ""
-do
-   [ -z "$TERMINAL" ] && break
-   ( [ -t 1 ] < $TERMINAL &> $TERMINAL ) 2>/dev/null && break
-done
-if [ -z "$TERMINAL" ] ; then
-	$LOGERR "FATAL: no terminal"
-	exit -1
-fi
-
 
 # frame work for commandline options part I {{{2
 # I use getopt, if it is in PATH. if getopt is not found, it will
@@ -2139,6 +2125,20 @@ fi
 case $link in
 
 drbd)
+	# QQQ thought this could be useful
+	# TERMINAL=/dev/tty
+	# maybe we can use $CONSOLE, which should be exported by init anyways?
+	#
+	for TERMINAL in /proc/$$/fd/0 /dev/tty /dev/console ""
+	do
+	   [ -z "$TERMINAL" ] && break
+	   ( [ -t 1 ] < $TERMINAL &> $TERMINAL ) 2>/dev/null && break
+	done
+	if [ -z "$TERMINAL" ] ; then
+		$LOGERR "FATAL: no terminal"
+		exit -1
+	fi
+
 	case $COMMAND in
 	checkconfig|$OPT_CHECK_ONLY) # {{{1
 		# on VERBOSITY level >= 2 this is done above already.



More information about the drbd-user mailing list