Following Cannot start Caddy as a systemd service :
I have the exact same issue. Caddy works just fine by launching it as a command line, but service fails to start and I have this errors in the syslog :
Aug 24 11:11:14 voiretmanger systemd[1]: Network Service is not active.
Aug 24 11:11:14 voiretmanger systemd[1]: Dependency failed for Wait for Network to be Configured.
Aug 24 11:11:14 voiretmanger systemd[1]: systemd-networkd-wait-online.service: Job systemd-networkd-wait-online.service/start failed with result 'dependency'.
Aug 24 11:11:14 voiretmanger systemd[1]: Started Caddy HTTP/2 web server.
I’m using the official Caddy service and everything was working fine for several months, until I had to update my Caddyfile to add a site.
I tried to find the solution in the previous thread mentioned earlier, but I was not able to make it work. If I remove the systemd-networkd-wait-online.service
directive, I don’t have the network error in the syslog, but Caddy does not start either. It just fails silently, as far as I can tell. If there is log somewhere indicating what’s happening, I have not found it.
Here’s the output of a service status :
➜ ~ service caddy status
● caddy.service - Caddy HTTP/2 web server
Loaded: loaded (/home/nicolas/config/etc/systemd/system/caddy.service; enabled; vendor preset: enabled)
Active: active (running) since ven. 2018-08-24 11:11:14 CEST; 5min ago
Docs: https://caddyserver.com/docs
Process: 14160 ExecReload=/bin/kill -USR1 $MAINPID (code=exited, status=0/SUCCESS)
Main PID: 14286 (caddy)
Tasks: 7
Memory: 10.0M
CPU: 165ms
CGroup: /system.slice/caddy.service
└─14286 /usr/local/bin/caddy -agree=true -email=nicolinux@gmail.com -conf=/etc/caddy/Caddyfile -root=/var/www
août 24 11:11:14 voiretmanger systemd[1]: Started Caddy HTTP/2 web server.
août 24 11:12:59 voiretmanger systemd[1]: Started Caddy HTTP/2 web server.
The service file is visible here, the caddyfile is available here. I’m running Ubuntu 16.04.5 LTS (GNU/Linux 4.4.0-133-generic x86_64).
Let me know if you need more information.