[Debian-ha-maintainers] [patch] low: init script: don't use -e argument to echo
Simon Horman
horms at verge.net.au
Wed Mar 10 00:14:51 UTC 2010
The -e argument to echo does not seemed to be supported by dash
and is treated as an literal.
# bash -c "echo -e fish"
fish
# dash -c "echo -e fish"
-e fish
The simple fix seems to be to just remove -e from invocations of echo.
the echo(1) man page documents the -e option as:
-e enable interpretation of backslash escapes
But none of the strings printed include such escape sequences.
This change removes the -e from the output if the init script
on systems where /bin/sh is dash:
# /etc/init.d/heartbeat start
Starting High-Availability services: mkdir: cannot create directory
`/var/run/heartbeat': File exists
...
-e Done.
Reported-by: Frederik Schüler <fs at debian.org>
Signed-off-by: Simon Horman <horms at verge.net.au>
Index: heartbeat/heartbeat/init.d/heartbeat.in
===================================================================
--- heartbeat.orig/heartbeat/init.d/heartbeat.in 2010-03-10 10:59:56.000000000 +1100
+++ heartbeat/heartbeat/init.d/heartbeat.in 2010-03-10 11:00:32.000000000 +1100
@@ -55,12 +55,12 @@ RUNDIR=@localstatedir@/run
echo_failure() {
- echo -e " Heartbeat failure [rc=$1]. $rc_failed"
+ echo " Heartbeat failure [rc=$1]. $rc_failed"
return $1
}
echo_success() {
- echo -e "$rc_done"
+ echo "$rc_done"
}
if
@@ -111,11 +111,11 @@ then
$HA_BIN/heartbeat -s
}
echo_failure() {
- echo -e " Heartbeat failure [rc=$1]. $rc_failed"
+ echo " Heartbeat failure [rc=$1]. $rc_failed"
return $1
}
echo_success() {
- echo -e "$rc_done"
+ echo "$rc_done"
}
else
. $DISTFUNCS
More information about the Debian-ha-maintainers
mailing list