post(caddy-2): must use "caddy reload" to reload config

- ce8860dbfe/init/caddy.service (L25)
This commit is contained in:
MDLeom 2020-08-30 09:23:35 +00:00
parent e12bca5baa
commit 86c5649e74
No known key found for this signature in database
GPG Key ID: 32D3E28E96A695E8
1 changed files with 6 additions and 0 deletions

View File

@ -2,6 +2,7 @@
title: Running Caddy 2 in NixOS 20.03
excerpt: Use stable v2 instead of beta release
date: 2020-05-24
updated: 2020-08-30
tags:
- server
- caddy
@ -84,6 +85,11 @@ in {
'' else ''
${cfg.package}/bin/caddy -root=/var/tmp -conf=${cfg.config}
'';
ExecReload = if isCaddy2 then ''
${cfg.package}/bin/caddy reload --config ${cfg.config} --adapter ${cfg.adapter}
'' else ''
"${pkgs.coreutils}/bin/kill -HUP $MAINPID"
'';
ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID";
Type = "simple";
User = "caddy";