my init script is broken with RHEL 6.2 (works fine on RHEL 5). I think it has something to do with the update to the bash shell.
Here's the part that fails:
# Check for custom run config
if [ -f "$JBOSS_HOME/bin/run-$SERVER_CONFIG.conf" ]; then
RUN_CONF="$JBOSS_HOME/bin/run-$SERVER_CONFIG.conf"
# Build start command
script=$(cat <<'EOF'
#!/bin/bash
RUN_CONF="JBOSS_HOME/bin/run-SERVER_CONFIG.conf"
export RUN_CONF
cd JBOSS_HOME/bin
JBOSS_HOME/bin/run.sh -c SERVER_CONFIG -b INTERFACE 1> JBOSS_CONSOLE 2>&1 &
echo $!)
else
script=$(cat <<'EOF'
#!/bin/bash
cd JBOSS_HOME/bin
JBOSS_HOME/bin/run.sh -c SERVER_CONFIG -b INTERFACE 1> JBOSS_CONSOLE 2>&1 &
echo $!)
fi
the shell says:
sh-4.1# /etc/init.d/jboss-webimage start
/etc/init.d/jboss-webimage start
/etc/init.d/jboss-webimage: line 106: unexpected EOF while looking for matching `)'
/etc/init.d/jboss-webimage: line 212: syntax error: unexpected end of file
any help would be most appreciated. i've tried using the jboss_init_redhat.sh, but that comes with a whole new set of problems. it doesn't properly capture the pid and i end up with an empty pid file among many other issues.