Apr 07 20:17:22 ferenginar systemd[1]: caddy.service: Start request repeated too quickly.
Apr 07 20:17:22 ferenginar systemd[1]: Failed to start Caddy HTTP/2 web server.
And:
Apr 07 20:22:07 ferenginar systemd[1]: Network Service is not active.
Apr 07 20:22:07 ferenginar systemd[1]: Dependency failed for Wait for Network to be Configured.
-- Subject: Unit systemd-networkd-wait-online.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit systemd-networkd-wait-online.service has failed.
--
-- The result is dependency.
Apr 07 20:22:07 ferenginar systemd[1]: systemd-networkd-wait-online.service: Job systemd-networkd-wait-online.service/start failed with result 'dependency'.
Apr 07 20:22:07 ferenginar systemd[1]: caddy.service: Start request repeated too quickly.
Apr 07 20:22:07 ferenginar systemd[1]: Failed to start Caddy HTTP/2 web server.
-- Subject: Unit caddy.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit caddy.service has failed.
Assuming you’ve got a network connection up and running on the host (this service normally fails if it can’t configure any interfaces), I’ve seen this happen before when the system was running NetworkManager (or some other network daemon) instead of systemd-networkd. What’s your network manager?
If I define any log directive inside the Caddyfile, I get exactly the same error message.
I solved it by simply removing the -log stdout from the ExecStart and define the logging inside the Caddyfile.
@Whitestrake I have this issue currently only at one particular server (running Ubuntu 16 LTS). … And “solved” does not necessarily mean it’s the right or best way but it solves the problem of not being able to start caddy as service with an enabled logging directive. If I run caddy with the same arguments as in the systemd script /usr/local/bin/caddy -log stdout -agree=true -conf=/etc/caddy/Caddyfile -root=/var/tmp on the terminal everything works fine.
I hope this clarifies my previous “solved” posting. I don’t wanted to state that this solution is perfect - because it isn’t - but it works temporarily (for me).
No worries, I just wanted to make sure there was no ambiguity - I was worried you might have thought that the log directive was the same and you weren’t losing anything by removing the flag. If the process log isn’t necessary and it’s causing some blocking issue, absolutely removing it is a fine workaround.