Before commenting I was getting two instances on of tomcat and one of dhis. I could kill dhis process with kill -9 but tomcat respawned every time with new PID.
So I have to issue sudo service tomcat9 stop and then issue the dhis2 startup command.
Why is thing happening and what is the solution so that i do not have to worry about reboots. These reboots were mainly due to system up gradation
My Linux is 20.04.1-Ubuntu and Java is version 11 and dhis2 version 2.36
Hi @amitta . I am not 100% sure I understand your problem. What I understand is that you have Tomcat running in your server and (I assume) is blocking the start up scripts of DHIS2? But then you said you could achieve having Tomcat and DHIS2 running so I am not sure.
I am assuming you are using Tomcat as the java server for DHIS2 but maybe you expect DHIS2 to spin up its own version and not the one from the startup scripts of the Operative System?
In any case, should you want to stop Tomcat starting from your scripts, -assuming you are on Ubuntu using systemd (which I am assuming as it is the default service system for Ubuntu in your version)- you can disable permanently the service by running
systemctl disable tomcat9
But before I would recommend running the following command to make sure my assuming is correct
systemctl status tomcat9
Also, I am not sure how do you usually start DHIS2. You might have some user scripts to start it manually or you might want to start it automatically. For the later you have many options like creating a systemd service, enabling a cron job, creating init scripts, etc
Thanks for your reply and sorry for sending an ambiguous message.
What i was saying that with DHIS installation, I had also set up init.d script also. SO with every reboot, tomcat service and dhis service both of the were starting, As a result DHIS server was not loading. But what i am not able to understand where tomcat startup script is mentioned. In that i wo;d go there and disable/remove it.
How i am starting DHIS2?
Right now by manually executing /home/dhis/tomcat-dhis/bin/startup.sh
I cannot know how your DHIS2 is starting but I am assuming you set up some scripts in /etc/rc.local ? If your goal is to have only DHIS2 running (which would produce the start of Tomcat as well) you should disable the automatic startup of Tomcat.
I am assuming (again) that you installed Tomcat via apt-get or a similar tool and it is included as a service. Please run the mentioned command
systemctl status tomcat9
and verify if it says something like enabled. For example this is the docker service in my machine (sorry but don’t have tomcat) where you can see the service is enabled. Enabled means that will start up as soon as the operative system finished loading.
I believe you get dead because you stopped it manually as you mentioned before. If you restart the machine you should have it differently. In any case, this doesn’t block you from disabling by using the command explained above.