已加载:错误设置(原因单元 tomcat.service 的单元文件设置不正确。)我正在使用 ubuntu20.04

已加载:错误设置(原因单元 tomcat.service 的单元文件设置不正确。)我正在使用 ubuntu20.04

[这是尝试使用 sudo systemctl status tomcat 运行 tomcat 后出现的错误]

[output]
tunji@tunji-HP-EliteBook-840-G4:~$ sudo nano /etc/systemd/system/tomcat.service
tunji@tunji-HP-EliteBook-840-G4:~$ sudo systemctl status tomcat
Warning: The unit file, source configuration file or drop-ins of tomcat.service ch>
● tomcat.service - Apache Tomcat Web Application Container
     Loaded: bad-setting (Reason: Unit tomcat.service has a bad unit file setting.)
     Active: inactive (dead)

5月6日 06:52:43 tunji-HP-EliteBook-840-G4 systemd1:/etc/systemd/system/tomcat.s> 5月6日 06:52:43 tunji-HP-EliteBook-840-G4 systemd1:tomcat.service:服务已 > 5 月 6 日 06:53:32 tunji-HP-EliteBook-840-G4 systemd1:/etc/systemd/system/tomcat.s> 5月6日 06:53:32 tunji-HP-EliteBook-840-G4 systemd1:tomcat.service:服务已 > 5 月 6 日 07:06:33 tunji-HP-EliteBook-840-G4 systemd1:/etc/systemd/system/tomcat.s> 5月6日 07:06:33 tunji-HP-EliteBook-840-G4 systemd1:tomcat.service:服务已 > 5 月 6 日 07:27:13 tunji-HP-EliteBook-840-G4 systemd1:tomcat.service:服务已 > 5 月 6 日 07:27:47 tunji-HP-EliteBook-840-G4 systemd1:tomcat.service:服务有>

……………………………………………..

[我的单位档案]

Unit]
Description=Apache Tomcat Web Application Container
After=network.target

[Service]
Type=forking

User=tomcat
Group=tomcat

Environment=JAVA_HOME=/usr/lib/jvm/java-1.11.0-openjdk-amd64
Environment='JAVA_OPTS=-Djava.awt.headless=true-Djava.security.egd=file:///dev/./urandom'

Environment=CATALINA_PID=/var/tomcat/temp/tomcat.pid
Environment=CATALINA_BASE=/opt/tomcat
Environment=CATALINA_HOME=/opt/tomcat/
Environment='CATALINA_OPTS=-Xms512M -Xmx1024M -server -XX:+UseParallelGC'

ExecStart=/opt/tomcat/bin/startup.sh
ExecStart=/opt/tomcat/bin/shutdown.sh

UMask=0007
RestartSec=10
Restart=always

[Install]
WantedBy=multi-user.target

相关内容