无法启动 reload.service:未找到单元 reload.service

无法启动 reload.service:未找到单元 reload.service

我已在 tomcat 服务中添加此项:

[Unit]
Description=Apache Tomcat 8 Servlet Container
After=syslog.target network.target

[Service]
User=tomcat
Group=tomcat
Type=forking
Environment=CATALINA_PID=/opt/tomcat/tomcat.pid
Environment=CATALINA_HOME=/opt/tomcat
Environment=CATALINA_BASE=/opt/tomcat
ExecStart=/opt/tomcat/bin/startup.sh
ExecStop=/opt/tomcat/bin/shutdown.sh
Restart=on-failure

[Install]
WantedBy=multi-user.target

并使用了这个命令:

systemctl daemon-reload
systemctl start tomcat

出现此错误:

Failed to start reload.service: Unit reload.service not found.

谁能帮我。

答案1

如果您运行以下命令,将会出现以下错误消息:

$ sudo systemctl start reload 
Failed to start reload.service: Unit reload.service not found.

检查您是否确实运行了启动 tomcat 的正确命令,该命令应为:

$ sudo systemctl start tomcat

相关内容