nixpkgs/nixos/modules
Florian Klink 0244a8d5d7 nixos/caddy: don't set ExecReload if enableReload is disabled
Otherwise, setting services.caddy.enableReload to false fails in a very bad fashion:

The reload command still gets executed, but fails:

```
Apr 26 21:23:01 n1-rk1 systemd[1]: Reloading Caddy...
Apr 26 21:23:01 n1-rk1 caddy[70793]: {"level":"info","ts":1714166581.733018,"msg":"using provided configuration","config_file":"/etc/caddy/caddy_config","config_adapter":"caddyfile"}
Apr 26 21:23:01 n1-rk1 caddy[70793]: {"level":"warn","ts":1714166581.7353032,"msg":"Caddyfile input is not formatted; run 'caddy fmt --overwrite' to fix inconsistencies","adapter":"caddyfile","file":"/etc/caddy/caddy_config","line":3}
Apr 26 21:23:01 n1-rk1 caddy[70793]: Error: sending configuration to instance: performing request: Post "http://localhost:2019/load": dial tcp [::1]:2019: connect: connection refused
Apr 26 21:23:01 n1-rk1 systemd[1]: caddy.service: Control process exited, code=exited, status=1/FAILURE
Apr 26 21:23:01 n1-rk1 systemd[1]: Reload failed for Caddy.
```

… and the server is not restarted either, as a ExecReload= command is
specified.

Fix this, by only setting ExecReload if the reload exists.

The first empty string is still necessary to reset the old option.
2024-05-12 18:27:02 +03:00
..
config nixos/terminfo: always use buildPlatform's terminfo (#309108) 2024-05-06 09:04:43 +00:00
hardware Merge pull request #309052 from kira-bruneau/intel-gpu-tools 2024-05-07 23:28:45 +02:00
i18n/input-method nixos: remove all uses of lib.mdDoc 2024-04-13 10:07:35 -07:00
image nixos: remove all uses of lib.mdDoc 2024-04-13 10:07:35 -07:00
installer treewide: reanme renamed libinput options 2024-04-17 23:34:07 +02:00
misc nixos/manual: apply cfg.warningsAreErrors to nix eval as well 2024-04-21 18:01:26 +02:00
profiles nixos/top-level: Rename system.forbiddenDependenciesRegex to system.forbiddenDependenciesRegexes 2024-05-02 21:08:39 +03:00
programs nixos/fish: add package option 2024-05-07 00:34:38 -04:00
security Merge pull request #277626 from nbraud/nixos/pam/ssh-agent-auth-31611-fix 2024-04-28 09:24:38 +02:00
services nixos/caddy: don't set ExecReload if enableReload is disabled 2024-05-12 18:27:02 +03:00
system Merge pull request #306926 from tie/networkd-global-ipv6-privacy-extensions 2024-05-08 14:41:08 +03:00
tasks Merge pull request #287505 from jpds/zfs-scrub-trim-randomizedDelaySec 2024-05-10 02:11:13 +02:00
testing nixos/tests: set non-conflicting priority for logrotate disabling 2024-05-10 16:25:51 +03:00
virtualisation Merge pull request #307039 from adamcstephens/nixos-unstable 2024-05-09 09:59:37 -04:00
module-list.nix nixos/private-gpt: init 2024-05-11 22:42:04 +02:00
rename.nix treewide: rename renamed sddm/displayManager settings 2024-04-08 21:56:38 +02:00