I'd like to set in my dot-emacs a function to detect if an Emacs instance is already running, possibly exiting Emacs informing user.
To do this I should query the OS for running processes. However
does not return OS processes, but only those started by Emacs. How can I achieve the intended objective?