我已經在 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