I am quite new to Linux and want to know what to be done to launch a .sh file on machine startup. Basically, I have a server machine with Linux OS on it and want to run some jboss application when system restart/crashes
I added S99jBossServers
in rc2.d with link to /etc/rc.d/init.d/jBossServers.sh
and have given full permission(777) to jBossServers.sh
the content in jBossServers.sh
is as follows
#!/bin/sh
#
# chkconfig: 2345 80 30
# description:
#
RETVAL=0
start () {
/root/batch/startSikkimCA.sh
/root/batch/startSikkimSp.sh
}
stop () {
/root/batch/stopSikkimCA.sh
/root/batch/stopSikkimSp.sh
RETVAL=$?
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
start
;;
*)
start
;;
RETVAL=$?
esac
exit $RETVAL
I am not sure whether its correct or not but the 2 paths been refered in
start() and stop()
are correct, but still the application doesn't start on machine's restart.