Aqui está um erro:
Environment='JAVA_OPTS=-Djava.awt.headless=true - Djava.security.egd=file:/dev/./urandom'
^^
Remova esses dois espaços.
Este é o meu arquivo tomcat.service, localizado em 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
agora, quando eu verifico o status do meu tomcat, ele diz
ExecStop = / bin / kill -15 $ MAINPID (code = encerrado, status = 1 / FAILURE)
[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.
eu tentei usar o serviço tomcat restart, mas ele ainda diz que o serviço tomcat falhou. qual pode ser a causa disso?
Aqui está um erro:
Environment='JAVA_OPTS=-Djava.awt.headless=true - Djava.security.egd=file:/dev/./urandom'
^^
Remova esses dois espaços.