Issue
So far (not working) my call looks like this:
ssh -tt -q ${SERVER} "sudo su -l ${USER} -c nohup ${SCRIPT_DIR}/Script.sh start < /dev/null >/dev/null 2>&1 &"
The meat of the script goes something like this:
case "$1" in
'start')
echo 'Starting server.'
$JAVA_HOME/java -Xmx1024m -jar myJarFile.jar &
echo $!>$PID_FILE
;;
'stop')
kill ${cat $PID_FILE}
;;
*)
echo "Usage: $0 {start | stop}"
exit 1
;;
esac
exit 0
The stop side works (Slightly different, but start won't work that way either. I'd guess it works because it's just a quick kill). I've monkeyed around umpteen different ways on both sides of the equation. Can anyone steer me in the right direction?
Thanks, Eric
Solution
No takers, guess I'll just move it to a service so it has its own shell...
Answered By - Eric