This would be useful if I install and maintain caddy using sudo apt install caddy with updates as part of regular system updates. At the moment, I do this as a manual step which I sometimes forget.
That’s an interesting idea. Basically it would have to replace the binary immediately then shut down and “hope” some other process will attempt to restart the process (which systemd should). There’s some danger of potentially causing infinite restart loops though if Caddy isn’t able to start successfully.
Also, it might run into permission problems.
Where the executable might be owned by user root (e.g. apt install default), but the actual process is running as user caddy (current systemd service default).
Given the challenges with using some variation of the add-package functionality as I suggest above, does anyone have any advice on how to automatically manage updated for non-standard packages?
I still have the problem that my system becomes unusable after caddy is updated.
When I do a a periodic system update (sudo apt upgrade) that includes a new version of Caddy, the new binary is installed but without any modules that were installed using caddy add-package.
I guess that the easiest thing is to include Caddy package updates in my system update script, with some error recovery / notification (that prevents update loops).