Today I learned: If you don't add (require 'server) before calling (daemonp), your Emacs daemon will silently hang.
The thing I don't actually want to learn at all, ever.
It took 3 hours to debug, I found solution completely accidentially: just forgot to remove it, when was playing with (server-running-p).
@abcdw Do you have a minimal test case to reproduce this? I don't see it with my config and
emacs -Q --daemon -f daemonp
and similar attempts don't hang for me either.