Make Emacs-Server Write a PID File

Oddly, emacs-server doesn’t seem to have an option to write a PID file when it starts up. Here’s some ELisp you can drop into your init file to make it happen: