Це мій файл tomcat.service, який знаходиться за адресою etc / systemd / system
[root@ip-10-81-27-248 system]# less tomcat.service
Systemd unit file for tomcat
[Unit]
Description=Apache Tomcat Web Application Container
After=syslog.target network.target
[Service]
Type=forking
SuccessExitStatus=143
Environment=TOMCAT_JAVA_HOME=/usr/java/latest/jre
Environment=JAVA_HOME=/usr/java/latest/jre
Environment=CATALINA_PID=/opt/tomcat/temp/tomcat.pid
Environment=CATALINA_HOME=/opt/tomcat
Environment=CATALINA_BASE=/opt/tomcat
Environment='CATALINA_OPTS=-Xms512M -Xmx1024M -server -XX:+UseParallelGC'
Environment='JAVA_OPTS=-Djava.awt.headless=true - Djava.security.egd=file:/dev/./urandom'
ExecStart=/opt/tomcat/bin/startup.sh
ExecStop=/bin/kill -15 $MAINPID
User=tomcat
Group=tomcat
[Install]
WantedBy=multi-user.target
тепер, коли я перевіряю статус мого tomcat, він говорить
ExecStop = / bin / kill -15 $ MAINPID (код = вийшов, статус = 1 / НЕВЕРОЯТЬ)
[root@ip-10-81-27-248 system]# service tomcat status -l
Redirecting to /bin/systemctl status -l tomcat.service
● tomcat.service - Apache Tomcat Web Application Container
Loaded: loaded (/etc/systemd/system/tomcat.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Tue 2017-04-25 02:43:57 UTC; 6min ago
Process: 16187 ExecStop=/bin/kill -15 $MAINPID (code=exited, status=1/FAILURE)
Process: 16154 ExecStart=/opt/tomcat/bin/startup.sh (code=exited, status=0/SUCCESS)
Main PID: 16164 (code=exited, status=0/SUCCESS)
Apr 25 02:43:54 ip-10-81-27-248.us-west-2.compute.internal systemd[1]: Starting Apache Tomcat Web Application Container...
Apr 25 02:43:54 ip-10-81-27-248.us-west-2.compute.internal startup.sh[16154]: Existing PID file found during start.
Apr 25 02:43:54 ip-10-81-27-248.us-west-2.compute.internal startup.sh[16154]: Removing/clearing stale PID file.
Apr 25 02:43:54 ip-10-81-27-248.us-west-2.compute.internal startup.sh[16154]: Tomcat started.
Apr 25 02:43:54 ip-10-81-27-248.us-west-2.compute.internal systemd[1]: Started Apache Tomcat Web Application Container.
Apr 25 02:43:57 ip-10-81-27-248.us-west-2.compute.internal systemd[1]: tomcat.service: control process exited, code=exited status=1
Apr 25 02:43:57 ip-10-81-27-248.us-west-2.compute.internal systemd[1]: Unit tomcat.service entered failed state.
Apr 25 02:43:57 ip-10-81-27-248.us-west-2.compute.internal systemd[1]: tomcat.service failed.
Я спробував скористатися службою перезавантаження tomcat, але він все ще говорить, що служба tomcat не вдалася. що може бути причиною цього?
Ви подивилися цю відповідь unix.stackexchange.com/questions/235891/…
—
Шайлеш