Could you please guide me with the following,
Adding the ConnectAll Application restart script for reference:
#!/bin/sh -e
# JIRA startup script
#chkconfig: 2345 80 05
#description: JIRA
# Define some variables
# Name of app ( JIRA, Confluence, etc )
APP=connectall
APP1=Mule
# Name of the user to run as
USER=root
# Location of application's bin directory
BASE=/mulesoft/connectall/CATomcat/bin
#BASEMule=/mulesoft/connectall/mulesoft/mule-standalone-3.9.0
# Location of Java JDK
export JAVA_HOME=/usr/jdk1.8.0_171
case "$1" in
# Stop command
stop)
#echo "Stopping $APP"
#/bin/su -m $USER -c "$BASE/shutdown.sh &> /dev/null"
#echo "$APP stopped successfully"
echo "Stopping $APP1"
/bin/su -m $USER -c "/mulesoft/connectall/mulesoft/mule-standalone-3.9.0/bin/mule stop &> /dev/null"
echo "$APP1 stopped successfully"
echo "Stopping $APP"
/bin/su -m $USER -c "$BASE/shutdown.sh &> /dev/null"
echo "$APP stopped successfully"
;;
# Start command
start)
echo "Starting $APP"
/bin/su -m $USER -c "$BASE/startup.sh &> /dev/null"
echo "$APP started successfully"
echo "Starting $APP1"
/bin/su -m $USER -c "/mulesoft/connectall/mulesoft/mule-standalone-3.9.0/bin/mule start &> /dev/null"
echo "$APP1 started successfully"
;;
# Stop command
# stop)
# echo "Stopping $APP"
# /bin/su -m $USER -c "$BASE/bin/shutdown.sh &> /dev/null"
#echo "$APP stopped successfully"
#;;
#Restart command
restart)
$0 stop
sleep 60
$0 start
;;
*)
echo "Usage: /etc/init.d/$APP restart}"
exit 1
;;
esac
The above script is in the name connectall-auto-restart in the location /mulesoft (this is an external mount).
So when I execute the script manually from the location /mulesoft using ./connectall-auto-restart restart the application restarts fine.
However when I configure the same in a cron job like below
30 08 1-7 * 6 /mulesoft/connectall-auto-restart
30 08 17-23 * 6 /mulesoft/connectall-auto-restart
the cron runs exactly at the time but the cron does not initiate the script. (Meaning the cron triggers the job but my application is not restarting).
root@balqmu101:/var/log# cat syslog | grep connectall-auto-restart
Sep 18 08:30:01 balqmu101 CRON[3232401]: (root) CMD (/mulesoft/connectall-auto-restart)
I have also tried the following and that also is not working.
30 08 1-7 * 6 /mulesoft/connectall-auto-restart restart
30 08 17-23 * 6 /mulesoft/connectall-auto-restart restart
Regards
Aravind Viswanathan