I’m trying to run a caddy proxy (as docker container) through systemd. It’s working perfectly but sometimes systemd stop the service without any reason…
So I have these type of log
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.
My caddy service
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
So when I restart manually the caddy service, it doesn’t send any error and it’s working.
So do you know why Systemd stop my service like that ??
Thanks in advance for your help