paperring
September 14th, 2020, 02:48 PM
I installed Tomcat 9.0.37 on Ubuntu 18.04 VPS. Problem is after starting the Tomcat, it makes inactive itself automatically after sometimes and when active state gives a status notification like this:
Starting Tomcat 9 servlet container...
Sep 14 14:23:55 ubuntuServer startup.sh[23466]: Existing PID file found during start.
Sep 14 14:23:55 ubuntuServer startup.sh[23466]: Removing/clearing stale PID file.
Sep 14 14:23:55 ubuntuServer startup.sh[23466]: Tomcat started.
Sep 14 14:23:55 ubuntuServer systemd[1]: Started Tomcat 9 servlet container.
I thougth that Tomcat can not delete its pid file when restarting but I can't find where the problem is. Here is "/etc/systemd/system/tomcat.service" file ("latest" directory is a symbolic link which will point tomcat installation directory):
[Unit]
Description=Tomcat 9 servlet container
After=network.target
[Service]
Type=forking
User=tomcat
Group=tomcat
Environment="JAVA_HOME=/opt/jdk/jdk1.8.0_261"
Environment="JAVA_OPTS=-Djava.security.egd=file:///dev/urandom"
Environment="CATALINA_BASE=/opt/tomcat/latest"
Environment="CATALINA_HOME=/opt/tomcat/latest"
Environment="CATALINA_PID=/opt/tomcat/latest/temp/tomcat.pid"
Environment="CATALINA_OPTS=-Xms512M -Xmx1024M -server -XX:+UseParallelGC"
ExecStart=/opt/tomcat/latest/bin/startup.sh
ExecStop=/opt/tomcat/latest/bin/shutdown.sh
[Install]
WantedBy=multi-user.target
Any idea to solving this?
Starting Tomcat 9 servlet container...
Sep 14 14:23:55 ubuntuServer startup.sh[23466]: Existing PID file found during start.
Sep 14 14:23:55 ubuntuServer startup.sh[23466]: Removing/clearing stale PID file.
Sep 14 14:23:55 ubuntuServer startup.sh[23466]: Tomcat started.
Sep 14 14:23:55 ubuntuServer systemd[1]: Started Tomcat 9 servlet container.
I thougth that Tomcat can not delete its pid file when restarting but I can't find where the problem is. Here is "/etc/systemd/system/tomcat.service" file ("latest" directory is a symbolic link which will point tomcat installation directory):
[Unit]
Description=Tomcat 9 servlet container
After=network.target
[Service]
Type=forking
User=tomcat
Group=tomcat
Environment="JAVA_HOME=/opt/jdk/jdk1.8.0_261"
Environment="JAVA_OPTS=-Djava.security.egd=file:///dev/urandom"
Environment="CATALINA_BASE=/opt/tomcat/latest"
Environment="CATALINA_HOME=/opt/tomcat/latest"
Environment="CATALINA_PID=/opt/tomcat/latest/temp/tomcat.pid"
Environment="CATALINA_OPTS=-Xms512M -Xmx1024M -server -XX:+UseParallelGC"
ExecStart=/opt/tomcat/latest/bin/startup.sh
ExecStop=/opt/tomcat/latest/bin/shutdown.sh
[Install]
WantedBy=multi-user.target
Any idea to solving this?