Also, if the files are sitting underneath
/home/ubuntu why are you using sudo to start/stop it in the first
place...
I tried without sudo also, (may be
the last attempt I tried was with sudo, that's why the copy pasted code
is having sudo, but to make sure it do not work without sudo also)
Or, approaching it from the opposite perspective, if you're going to
run
it as root, why locate it under /home/ubuntu instead of someplace like
/opt?
I tried creating my folder
structure in /d00/......, and then tried to run the script with sudo,
still everything works except the start/stop of tomcat.