Commit 6cc9977
fix(caddy): re-chown /var/log/caddy after validate, before service start
`caddy validate` is run as root in 10-caddy.sh and side-effects the
global log directive — it opens /var/log/caddy/caddy.log, creating the
file as root:root 0600. Then when the systemd unit starts caddy under
User=caddy, the daemon can't append to its own log and dies with
"open /var/log/caddy/caddy.log: permission denied".
Add a chown -R caddy:caddy on the log dir right before systemctl
restart, so any files validate touched are handed back to the runtime
user.
Not an SELinux issue: confirmed binary is bin_t, log dir is var_log_t,
no AVCs at the failure timestamp.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 137b3dc commit 6cc9977
1 file changed
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
458 | 458 | | |
459 | 459 | | |
460 | 460 | | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
461 | 467 | | |
462 | 468 | | |
463 | 469 | | |
| |||
0 commit comments