Solution 1:
Echo the PID inside the commands executed by "su":
/bin/su - $USER -c "cd $PATH;echo $PASSWORD | \
$JAVA -Xmx256m -jar $PATH/app.jar -d > /dev/null & echo $! > $PIDFILE"
Echo the PID inside the commands executed by "su":
/bin/su - $USER -c "cd $PATH;echo $PASSWORD | \
$JAVA -Xmx256m -jar $PATH/app.jar -d > /dev/null & echo $! > $PIDFILE"