Skip to content

Commit

Permalink
Low: jboss: Check ROTATELOGS command at the validate_all_jboss
Browse files Browse the repository at this point in the history
  • Loading branch information
NAKAHIRA Kazutomo committed Oct 3, 2013
1 parent 562ab65 commit 90122d3
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions heartbeat/jboss
Expand Up @@ -105,16 +105,6 @@ monitor_jboss()

rotate_console()
{
# Look for rotatelogs/rotatelogs2
if [ -x /usr/sbin/rotatelogs ]; then
ROTATELOGS=/usr/sbin/rotatelogs
elif [ -x /usr/sbin/rotatelogs2 ]; then
ROTATELOGS=/usr/sbin/rotatelogs2
else
ocf_log warn "rotatelogs command not found."
return 1
fi

# Clean up and set permissions on required files
rm -rf "$CONSOLE"
mkfifo -m700 "$CONSOLE"
Expand Down Expand Up @@ -497,6 +487,13 @@ validate_all_jboss()
return $OCF_ERR_INSTALLED
fi

if ocf_is_true $ROTATELOG_FLG; then
if [ ! -x "$ROTATELOGS" ]; then
ocf_log err "rotatelogs command does not exist."
return $OCF_ERR_INSTALLED
fi
fi

return $OCF_SUCCESS
}

Expand Down Expand Up @@ -560,6 +557,16 @@ export JAVA_HOME JAVA_OPTS JBOSS_HOME JBOSS_BASE_DIR

JAVA=${JAVA_HOME}/bin/java

ROTATELOGS=""
if ocf_is_true $ROTATELOG_FLG; then
# Look for rotatelogs/rotatelogs2
if [ -x /usr/sbin/rotatelogs ]; then
ROTATELOGS=/usr/sbin/rotatelogs
elif [ -x /usr/sbin/rotatelogs2 ]; then
ROTATELOGS=/usr/sbin/rotatelogs2
fi
fi

validate_all_jboss
rc=$?

Expand Down

0 comments on commit 90122d3

Please sign in to comment.