openlava/openlava — Issue #14: openlava init script syntax error
Author: cansmith
Created: 2012-01-05 22:18:57+00:00
State: open

on Ubuntu 11.11 I get the following error from /etc/init.d/openlava:

plato:~> sudo /etc/init.d/openlava start
[: 75: start: unexpected operator
Starting daemons...
lim started
res started
sbatchd started

At this line there is an equal check using '==' which isn't allowed by /bin/sh (which is /bin/dash on Ubuntu), even though /bin/bash allows this.

plato:~/src/openlava> git diff
diff --git a/config/openlava.in b/config/openlava.in
index 1d4f3c1..c6fafeb 100755
--- a/config/openlava.in
+++ b/config/openlava.in
@@ -68,7 +68,7 @@ kill_daemons()
# cases previously running daemons are
# killed.
opcode="$1"
-if [ "$opcode" == "restart" ]
+if [ "$opcode" = "restart" ]
then
opcode="start"
echo "Stopping daemons..."