But I believe none of them worked, the reason is that I sabotaged the Caddyfile in order to check if it would fail when during the restart. I added a number on the url of the site, so instead of saying https://www.mysite.com it says 1https://www.mysite.com (Prefixed with the 1) but after sending the signals above it did not fail. It simply kept on going.
Am comparing this to literally killing Caddy and then manually starting it again with caddy &
When I manually do this, it fails correctly saying that there is a 1 in the url. But when I send the signals it does not. Now my question is:
Is this a bug?
Am I sending the signals in a wrong way?
Is there a parameter to restart Caddy (eg: caddy --restart)
Are the signals sent actually working but caddy reloads the script and fixes the configuration?
Basically, what is going on here, am I wrong or am I missing something?
Caddy checks the configuration when it gets a USR1 signal, so if the config is corrupt, it’ll keep using the old one. To test it, you’ll have to change the config to something valid, but different.
Jeez, thank you Cylindric. Am used to dumb web servers, did not know Caddy had that behavior. So just to confirm, the commands used to send the signal are correctly working, it’s just that Caddy sticks with the config that works.
Yep I think so. I just tested it, and interestingly Caddy doesn’t create a log entry for when a reload happens. I really think it should! Maybe @matt or someone with knowledge can confirm that it doesn’t log?