Systemd无故停止Docker服务

时间:2019-05-14 09:50:22

标签: docker systemd caddy

我正在尝试通过systemd运行caddy代理(作为docker容器)。 它工作正常,但有时systemd无缘无故停止服务。...

所以我有这类日志

mai 07 14:47:00 server docker[2415]: 2019/05/07 14:47:00 [INFO]  - No such site at :80 (Remote: 165.227.153.227, Referer: )
mai 07 15:25:15 server systemd[1]: Stopping Caddy service which will proxy the kibana server...
mai 07 15:25:19 server docker[17301]: caddy-proxy-service
mai 07 15:25:19 server systemd[1]: caddy.service: Main process exited, code=exited, status=137/n/a
mai 07 15:25:20 server docker[17419]: caddy-proxy-service
mai 07 15:25:20 server systemd[1]: caddy.service: Failed with result 'exit-code'.
mai 07 15:25:20 server systemd[1]: Stopped Caddy service which will proxy the kibana server.

我的童车服务

cat /etc/systemd/system/caddy.service
[Unit]
Description=Caddy service which will proxy the kibana server
Requires=snap.docker.dockerd.service
After=snap.docker.dockerd.service

[Service]
Restart=always
ExecStartPre=/snap/bin/docker pull abiosoft/caddy
ExecStart=/snap/bin/docker run --name caddy-proxy-service --net=host -e ACME_AGREE=true -v /etc/caddy/Caddyfile:/etc/Caddyfile -v /etc/caddy/certs:/root/.caddy abiosoft/caddy
ExecStop=/snap/bin/docker kill caddy-proxy-service
ExecStopPost=/snap/bin/docker rm caddy-proxy-service
ExecReload=/snap/bin/docker restart caddy-proxy-service

[Install]
WantedBy=multi-user.target

因此,当我手动重新启动caddy服务时,它不会发送任何错误,并且可以正常工作。

那么你知道为什么Systemd那样停止我的服务吗?

在此先感谢您的帮助;)

0 个答案:

没有答案