startup.sh will not run on ubuntu

Hi everyone:

I am new with Ubuntu, so that might be my issue… I downloaded the 7.1 tomcat bundle to the /opt directory, configured all files to connect to the installed postgres db, and configured the setenv.sh to use postgres.

I tried running startup.sh as root from the directory, but got permission denied.

root@CIFE:/opt/BonitaBPM/bin# /opt/BonitaBPM/bin/startup.sh
-bash: /opt/BonitaBPM/bin/startup.sh: Permission denied

then I tried using sudo, and got command not found.

root@CIFE:/opt/BonitaBPM/bin# sudo /opt/BonitaBPM/bin/startup.sh
sudo: /opt/BonitaBPM/bin/startup.sh: command not found

here is the list of the directory:
root@CIFE:/opt/BonitaBPM/bin# ls -lt
total 796
-rw-r–r-- 1 root root 1525 Sep 29 13:40 setenv.sh
-rw-r–r-- 1 root root 20779 Sep 22 00:12 catalina.sh
-rw-r–r-- 1 root root 1922 Sep 22 00:12 configtest.sh
-rw-r–r-- 1 root root 7888 Sep 22 00:12 daemon.sh
-rw-r–r-- 1 root root 1965 Sep 22 00:12 digest.sh
-rw-r–r-- 1 root root 3459 Sep 22 00:12 setclasspath.sh
-rw-r–r-- 1 root root 1902 Sep 22 00:12 shutdown.sh
-rw-r–r-- 1 root root 1904 Sep 22 00:12 startup.sh
-rw-r–r-- 1 root root 5024 Sep 22 00:12 tool-wrapper.sh
-rw-r–r-- 1 root root 1908 Sep 22 00:12 version.sh
-rw-r–r-- 1 root root 27861 Sep 22 00:12 bootstrap.jar
-rw-r–r-- 1 root root 13003 Sep 22 00:12 catalina.bat
-rw-r–r-- 1 root root 2168 Sep 22 00:12 catalina-tasks.xml
-rw-r–r-- 1 root root 24283 Sep 22 00:12 commons-daemon.jar
-rw-r–r-- 1 root root 204944 Sep 22 00:12 commons-daemon-native.tar.gz
-rw-r–r-- 1 root root 2040 Sep 22 00:12 configtest.bat
-rw-r–r-- 1 root root 2091 Sep 22 00:12 digest.bat
-rw-r–r-- 1 root root 3195 Sep 22 00:12 setclasspath.bat
-rw-r–r-- 1 root root 2020 Sep 22 00:12 shutdown.bat
-rw-r–r-- 1 root root 2022 Sep 22 00:12 startup.bat
-rw-r–r-- 1 root root 38195 Sep 22 00:12 tomcat-juli.jar
-rw-r–r-- 1 root root 387417 Sep 22 00:12 tomcat-native.tar.gz
-rw-r–r-- 1 root root 4021 Sep 22 00:12 tool-wrapper.bat
-rw-r–r-- 1 root root 2026 Sep 22 00:12 version.bat
-rw-r–r-- 1 root root 1328 Sep 17 10:54 setenv.bat
root@CIFE:/opt/BonitaBPM/bin#

any ideas how to get startup.sh to kick in?

Hi,

Your issue is related to file permissions.

First of all I recommend not to use root user but a normal user. I will assume that you have a user named test and group of user named test (replacing test with your Ubuntu username should work).

First make sure that test is the owner of all files:
sudo chown -R test:test /opt/BonitaBPM

Then make sure that the test user have the right to execute the shell script files (i.e. *.sh files):
chmod u+x /opt/BonitaBPM/bin/*.sh

Now you should be able to run /opt/BonitaBPM/bin/startup.sh using test user account.

Hi Antoine,

I guess we are on the right track.

I get:

bonita@CIFE:/opt$ /opt/BonitaBPM/bin/startup.sh
Using CATALINA_BASE: /opt/BonitaBPM
Using CATALINA_HOME: /opt/BonitaBPM
Using CATALINA_TMPDIR: /opt/BonitaBPM/temp
Using JRE_HOME: /usr/lib/jvm/java-7-openjdk-amd64/jre
Using CLASSPATH: /opt/BonitaBPM/bin/bootstrap.jar:/opt/BonitaBPM/bin/tomcat-juli.jar
Using CATALINA_PID: /opt/BonitaBPM/catalina.pid
Existing PID file found during start.
Removing/clearing stale PID file.
Tomcat started.

but I don’t see a Tomcat service running, and if I try accessing the portal, I get no page found… http://server:8080/bonita

Any ideas?

Try to run the following command to find out if Tomcat (the one located in /opt/BonitaBPM) is running (Tomcat run on top of Java Virtual Machine): ps -ef | grep java.

If Tomcat is not running, make sure that you didn’t installed the Ubuntu Tomcat package (or at least make sure it is not running). You can check if Tomcat Ubuntu package is installed by running: dpkg -l | grep tomcat

If Tomcat is not running I recommend to delete all files in /opt/BonitaBPM/logs folder and try to start it again. Then you can take a look at catalina.outand bonita*.loglogs files.

If Tomcat is running, get it’s PID (the first number in ps command output) and run the following command with it: ss -l -n -p | grep 1234(replace 1234 by the PID you get from ps command). Output of this command should list you the port on which Tomcat is listening.

If you cannot identify what cause the issue, please share the output of above command and logs files.

Hi Antoine:

Found the reason
Ubuntu has a built in firewall called ufw

to check the status of it:
sudo ufw status verbose

I added port 8080 to be allowed:
sudo ufw allow 8080

and now everything works as expected.

Thank you so much for your kind help

thanks to Antoine’s response as it was a rights issue