I wrote init.d script that suppose to run java CLI proccess.
The problem is that when i stop it, i get [failed] and the proccess is still running.
thanks
#!/usr/bin/env bash
#
# chkconfig: 345 97 03
#
# processname: quotes-srv
#
#
# source function library
. /etc/rc.d/init.d/functions
NAME=quotes-srv
start() {
echo -n $"Starting $NAME: "
daemon +19 java -Dlog4j.configuration="file:/opt/quotes/properties/log4j/log4j.properties" -Dproperties_folder="/opt/quotes/properties/app/" -jar /opt/quotes/trade-0.0.1-SNAPSHOT-jar-with-dependencies.jar &
touch /var/lock/subsys/$NAME
}
stop() {
echo -n $"Stopping $NAME: "
killproc $NAME
echo
rm -f /var/lock/subsys/$NAME
}
restart() {
stop
start
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart|force-reload|reload)
restart
;;
condrestart|try-restart)
[ -f /var/lock/subsys/$NAME ] && restart
;;
status)
status $NAME
;;
*)
echo $"Usage: $0 {start|stop|status|restart|reload|force-reload|condrestart}"
exit 1
esac
exit 0
killproc
, I'd guess it's looking for a process calledquotes-srv
, but the running process is calledjava
.