As discussed in https://lists.gnu.org/archive/html/emacs-devel/2021-10/msg01465.html , an option to stop the Emacs server when it has no clients anymore (which is similar to what some other apps do, for example browsers) would be useful. Patch attached.