这是我的单元文件:
# Systemd unit file for tomcat
[Unit]
Description=Apache Tomcat Web Application Container
Wants=network.target
After=syslog.target network-online.target
[Service]
Type=forking
User=tomcat
Group=tomcat
Environment=JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64
Environment=CATALINA_PID=/opt/tomcat/temp/tomcat.pid
Environment=CATALINA_HOME=/opt/tomcat
Environment=CATALINA_BASE=/opt/tomcat
Environment=CATALINA_OPTS=
Environment="JAVA_OPTS=-Dfile.encoding=UTF-8 -Dnet.sf.ehcache.skipUpdateCheck=true -Xms2g -Xmx4g"
ExecStart=/opt/tomcat/bin/startup.sh
ExecStop=/opt/tomcat/bin/shutdown.sh
[Install]
WantedBy=multi-user.target
进入
systemctl enable tomcat
systemctl start tomcat
运行该服务。但是当我重新启动时,我必须再次输入它。我以为启用该服务也会在启动时运行它。
知道下一步该做什么或检查什么吗?
我看了这里以及其他几个地方,但都没有成功。