I am trying the upgrading feature, then I found that pkill -usr1 caddy
has no effect after caddy is upgraded.
caddy version:
./caddy -version|head
Caddy 0.11.0 (+1f7b5ab Thu Jul 26 10:48:36 UTC 2018) (unofficial)
…
first , start caddy with an empty Caddyfile and with -log parameter
./caddy -log nohup.out
Activating privacy features… done.
http://:2015
in the second console, run:
pkill -usr1 caddy
in the third console, it shows:
tail -f nohup.out
…
2018/07/26 18:54:31 [INFO] SIGUSR1: Reloading
2018/07/26 18:54:31 [INFO] Reloading
2018/07/26 18:54:31 [INFO] Reloading complete
that’s all right, every thing goes as expected.
then run:
pkill -usr2 caddy
the log thows:
…
2018/07/26 18:55:08 [INFO] SIGUSR2: Upgrading
2018/07/26 18:55:08 [INFO] Upgrading
2018/07/26 18:55:08 http://:2015
2018/07/26 18:55:08 [INFO] Upgrade finished
this goes normal, the upgrade is OK
but… NOW, you pkill -usr1 caddy
again, you will found log int the third console :
…
2018/07/26 18:55:33 [INFO] SIGUSR1: Reloading
2018/07/26 18:55:33 [ERROR] SIGUSR1: no Caddyfile loader with which to reload Caddyfile
I dig a little into the source code, it seems that before upgrade, the caddy use Caddyfile to trigger reload action, however, in the upgrading process, the caddy config will be piped(via pipe()) to the child(in the memory), then the Caddyfile is useless after that.(the loaderUsed.loader
is not take effect for every)