I'm trying find out, how to start jboss with cron job at a particular time.
What I'm doing at the moment is setup a cron, then inside jboss startinstance script I put sleep 700 seconds untill jboss starts.
Is there a better way to actually know when jboss has successfully started and then continue with the flow after, instead of sleeping for 700 seconds? Did anyone do something similar?
I've got something like this, and I don't think this is the right solution :
#!/bin/ksh
#This script accepts one parameter URL which should to tracked
usage() {
msg=${1}
echo "ERROR: "
exit 1
}
args_no=$#
if [[ ${args_no} -ne 1 ]]; then
usage
fi
URL_to_check=${1}
jboss_status=1
while [[ ${jboss_status} -ne 0 ]]; do
wget ${URL_to_check} > /dev/null
jboss_status=$?
sleep 10
done
exit 0