我正在使用systemd在ubuntu 16.04机器上启动caddy网络服务器。每当我运行sudo service caddy start
和service caddy status
时,都会出现此错误:
● caddy.service - Caddy webserver
Loaded: loaded (/etc/systemd/system/caddy.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Mon 2016-08-29 05:03:02 EDT; 4s ago
Docs: https://caddyserver.com/
Process: 1135 ExecStart=/usr/local/bin/caddy -agree -email me@example -pidfile=/var/run/caddy/caddy.pid (code=exited, status
Main PID: 1135 (code=exited, status=1/FAILURE)
systemd[1]: Started Caddy webserver.
caddy[1135]: Activating privacy features... done.
caddy[1135]: 2016/08/29 05:03:02 Caddyfile:12 - Parse error: unknown property 'errors'
systemd[1]: caddy.service: Main process exited, code=exited, status=1/FAILURE
systemd[1]: caddy.service: Unit entered failed state.
systemd[1]: caddy.service: Failed with result 'exit-code'.
最佳答案
在我的/etc/systemd/system/caddy.service
文件中,有以下一行:
Restart=on-failure
注释掉该问题(使用
#
或;
)并重新启动服务,这显示了潜在的问题,该问题在我的Caddyfile中。编辑:
service caddy status
仅从日志中打印几行,因此有时您可以通过简单地查看完整的日志来找到潜在的问题。如果使用syslog,可通过以下方式完成:journalctl -u caddy
关于systemd - caddy.service启动请求重复太快,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/39202644/