Subject: 23.1.50; starting a server without forking a daemon

From: Kenny Stuart <[email-masked]>
Date: Tue, 17 Nov 2009 14:25:34 +0000

Please write in English if possible, because the Emacs maintainersusually do not have translators to read other languages for them.
Your bug report will be posted to the [email-masked] mailing list.
Please describe exactly what actions triggered the bugand the precise symptoms of the bug.  If you can, givea recipe starting from `emacs -Q':
This is a feature request to add the facility to start an emacs serverusing a command-line option that runs as a foreground process insteadof forking a daemon and exiting.
Motivation:
Forking a daemon then exiting the main process is incompatible withsystems that manage processes as services, such as launchd on OS X,therefore it is not possible to create an effective launchd serviceusing emacs in daemon mode.
Possible Solution:
For review I have included a patch that adds a --server command lineoption that does what the --daemon option does, except it runs theserver in the foreground process rather than forking a daemon andexiting.
Please note that I am new to emacs and nix based operating systems andin the short time I have had to spend on this was unable to add a SIGINThandler to gracefully shutdown the emacs server, not that it mattersto launchd since it should send SIGTERM, but a solution would be nice.
There appear to be issues on OS X with creating a new frame using the -c optionto emacsclient as emacs crashes (so far during garbage collection) whendoing this, however I am still learning the dev tools available to me on thisplatform and it will be a while before I could effectively report such bugs, sothis is just an FYI. 
As I'm using a debug build so I can investigate further, can you confirmthat the build configure options I've used are ok and not likely to becontributing to the instability, are there any other options I should beusing?
Please also note that this is the first time I have engaged with an opensource project so if I'm not doing it right let me know.
If Emacs crashed, and you have the Emacs process in the gdb debugger,please include the output from the following gdb commands:    `bt full' and `xbacktrace'.For information about debugging Emacs, please read the file/Applications/Emacs.app/Contents/Resources/etc/DEBUG.

In GNU Emacs 23.1.50.2 (x86_64-apple-darwin10.2.0, NS apple-appkit-1038.25) of 2009-11-17 on maverick.homeWindowing system distributor `Apple', version 10.3.1038configured using `configure  '--with-ns' '--enable-asserts' 'CFLAGS=-O0 -gdwarf-2 -g3 -Wno-pointer-sign''
Important settings:  value of $LC_ALL: nil  value of $LC_COLLATE: nil  value of $LC_CTYPE: nil  value of $LC_MESSAGES: nil  value of $LC_MONETARY: nil  value of $LC_NUMERIC: nil  value of $LC_TIME: nil  value of $LANG: en_GB.UTF-8  value of $XMODIFIERS: nil  locale-coding-system: utf-8-unix  default enable-multibyte-characters: t
Major mode: Text
Minor modes in effect:  tooltip-mode: t  mouse-wheel-mode: t  tool-bar-mode: t  menu-bar-mode: t  file-name-shadow-mode: t  global-font-lock-mode: t  font-lock-mode: t  global-auto-composition-mode: t  auto-composition-mode: t  auto-encryption-mode: t  auto-compression-mode: t  line-number-mode: t  transient-mark-mode: t
Recent input:<backspace> <backspace> L i b r a r y / L a u n c h A g e n t s / <help-echo> o r g . g n u . e n <backspace> m a c s - s e r v e r . p l i s t <return> <help-echo> t e x t / x m l <return> ~ / L i b r a r y / L a u n c h A g e n t s SPC s c r i p t SPC o r <backspace> <backspace> f o r SPC e m a c s SPC s e r v e r <left> <left> <left> <left> <left> <left> <left> <left> <left> <left> <left> <left> <left> <left> <left> <left> <left> <backspace> <backspace> <backspace> <backspace> <backspace> <backspace> p l s i t <backspace> <backspace> <backspace> i s t <return> a t t a c h m e n t <return> <backspace> <help-echo> <menu-bar> <file> <write-file> <help-echo> <backspace> <backspace> <backspace> <backspace> <backspace> <backspace> <backspace> <backspace> <backspace> <backspace> <backspace> <backspace> <backspace> <backspace> <backspace> <backspace> <backspace> D o <tab> c <tab> e m a c s - m a i l . t x t <return> <down-mouse-1> <mouse-1> <wheel-up> <double-wheel-up> <triple-wheel-up> <triple-wheel-up> <triple-wheel-up> <triple-wheel-up> <wheel-down> <double-wheel-down> <wheel-down> <double-wheel-down> <wheel-down> <double-wheel-down> <triple-wheel-down> <triple-wheel-down> <triple-wheel-down> <wheel-down> <double-wheel-down> <triple-wheel-down> <triple-wheel-down> <wheel-up> <double-wheel-up> <triple-wheel-up> <triple-wheel-up> <triple-wheel-up> <wheel-up> <double-wheel-up> <triple-wheel-up> <triple-wheel-up> <triple-wheel-up> <triple-wheel-up> <wheel-up> <double-wheel-up> <wheel-down> <double-wheel-down> <triple-wheel-down> <triple-wheel-down> <wheel-up> <double-wheel-up> <triple-wheel-up> <triple-wheel-up> <triple-wheel-up> <wheel-up> <wheel-up> <wheel-up> <down-mouse-1> <mouse-movement> <mouse-movement> <help-echo> <mouse-movement> <help-echo> <mouse-movement> <mouse-movement> <mouse-movement> <help-echo> <mouse-movement> <mouse-movement> <drag-mouse-1> <menu-bar> <edit> <copy> <down-mouse-1> <down-mouse-1> <down-mouse-1> <down-mouse-1> <down-mouse-1> <down-mouse-1> <down-mouse-1> <down-mouse-1> <down-mouse-1> <down-mouse-1> <down-mouse-1> <down-mouse-1> <down-mouse-1> <down-mouse-1> <down-mouse-1> <down-mouse-1> <down-mouse-1> <down-mouse-1> M-x r e p o r t - e m a c s - b u g <return>
Recent messages:Auto-saving...doneUndo!Auto-saving...doneMaking completion list...Saving file /Users/kstuart/Documents/emacs-mail.txt...Wrote /Users/kstuart/Documents/emacs-mail.txtbyte-code: Beginning of buffer [2 times]byte-code: End of buffer [2 times]byte-code: Beginning of buffer [8 times]Saved text from "Please write in English if possible, bec"
Load-path shadows:/Applications/Emacs.app/Contents/Resources/lisp/emacs-lisp/lucid hides /Applications/Emacs.app/Contents/Resources/lisp/obsolete/lucid/Applications/Emacs.app/Contents/Resources/lisp/emacs-lisp/levents hides /Applications/Emacs.app/Contents/Resources/lisp/obsolete/levents
Features:(ispell newcomment help-mode view shadow mail-extr message ecompleterfc822 mml mml-sec password-cache mm-decode mm-bodies mm-encode mailcapmail-parse rfc2231 rfc2047 rfc2045 qp ietf-drums mailabbrev nnheadergnus-util netrc time-date mm-util mail-prsvr gmm-utils wid-editmailheader canlock sha1 hex-util hashcash mail-utils emacsbug sendmailregexp-opt server tooltip ediff-hook vc-hooks lisp-float-type mwheelns-win easymenu tool-bar dnd fontset image fringe lisp-mode registerpage menu-bar rfn-eshadow timer select scroll-bar mldrag mouse jit-lockfont-lock syntax facemenu font-core frame cham georgian utf-8-langmisc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrewgreek romanian slovak czech european ethiopic indian cyrillic chinesecase-table epa-hook jka-cmpr-hook help simple abbrev loaddefs buttonminibuffer faces cus-face text-properties overlay md5 base64 format envcode-pages mule custom widget hashtable-print-readable backquotemake-network-process ns multi-tty emacs) 		 	   		  
_________________________________________________________________
Use Hotmail to send and receive mail from your different email accounts
http://clk.atdmt.com/UKM/go/186394592/direct/01/