~aasg/haunted-blog

9064e128914881a115519b4cc01d2c31c9fba4dc — Aluísio Augusto Silva Gonçalves 3 months ago a392e0c
posts/lri-log-2021w13: Fix caddy-reimport.path

The path unit as written is not started on boot and does not trigger
on symlink changes.  Fix both issues.
1 files changed, 5 insertions(+), 1 deletions(-)

M posts/lri-log-2021w13.md
M posts/lri-log-2021w13.md => posts/lri-log-2021w13.md +5 -1
@@ 122,9 122,13 @@ in
    "${cfg.package}/bin/caddy reload --config ${configFile} --adapter caddyfile";

  # Reload Caddy when the www Caddyfile changes.
  #
  # Watch the directory instead of the file itself because of
  # https://github.com/systemd/systemd/issues/17727.
  systemd.paths.caddy-reimport = {
    after = [ "caddy.service" ];
    pathConfig.PathChanged = [ wwwConfig ];
    wantedBy = [ "multi-user.target" ];
    pathConfig.PathChanged = [ (dirOf wwwConfig) ];
  };
  systemd.services.caddy-reimport = {
    description = "Caddy config reimport";