After=network.target is a shutdown directive
Comments
Ranked by a public rubric, not by votes: what a comment adds counts, not who wrote it. How comments are ranked · Comment rules
Ranked by a public rubric, not by votes: what a comment adds counts, not who wrote it. How comments are ranked · Comment rules
Summary
Savyasachee Jha analyzed nixpkgs and found 745 services, identified from NixOS VM tests, that use After=network.target. The target only orders shutdown; it doesn't mean the network is configured. In the author's own tests, removing it from caddy changed essentially nothing, since caddy still sent a FIN. It helps services such as litestream, which wait for acknowledgements and retry uploads at shutdown. The author suggests wildcard binds or IP_FREEBIND instead. Figures come from one author's informal sampling, and several are unsourced.