unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Juanma Barranquero" <lekktu@gmail.com>
To: "Ulrich Mueller" <ulm@gentoo.org>
Cc: Nick Roberts <nickrob@snap.net.nz>,
	Dan Nicolaescu <dann@ics.uci.edu>,
	Stefan Monnier <monnier@iro.umontreal.ca>,
	emacs-devel@gnu.org
Subject: Re: bug in server-start
Date: Tue, 16 Dec 2008 10:38:10 +0100	[thread overview]
Message-ID: <f7ccd24b0812160138i7d3e26d4tb1061ee7e41bc676@mail.gmail.com> (raw)
In-Reply-To: <18759.21210.387155.565065@a1ihome1.kph.uni-mainz.de>

On Tue, Dec 16, 2008 at 08:03, Ulrich Mueller <ulm@gentoo.org> wrote:

> Exit with an error, please. And if possible, the parent process should
> return a nonzero exit status. (AFAICS, not calling daemon-initialized
> should be sufficient for this, but I haven't tested it.)

Please, try the attached patch.

    Juanma



Index: lisp/server.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/server.el,v
retrieving revision 1.176
diff -u -2 -r1.176 server.el
--- lisp/server.el	12 Dec 2008 00:33:34 -0000	1.176
+++ lisp/server.el	16 Dec 2008 09:21:13 -0000
@@ -480,5 +480,6 @@
 	  (ignore-errors (delete-file server-file))
 	(setq server-mode nil) ;; already set by the minor mode code
-	(error "Server %S is already running" server-name))
+	(display-warning 'server (format "Server %S is already running" server-name))
+	(setq leave-dead t))
       ;; If this Emacs already had a server, clear out associated status.
       (while server-clients
@@ -487,5 +488,5 @@
       (if leave-dead
 	  (progn
-	    (server-log (message "Server stopped"))
+	    (unless (eq t leave-dead) (server-log (message "Server stopped")))
 	    (setq server-process nil))
 	;; Make sure there is a safe directory in which to place the socket.
Index: lisp/startup.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/startup.el,v
retrieving revision 1.523
diff -u -2 -r1.523 startup.el
--- lisp/startup.el	22 Nov 2008 20:44:42 -0000	1.523
+++ lisp/startup.el	16 Dec 2008 09:22:11 -0000
@@ -695,4 +695,5 @@

 (defvar server-name)
+(defvar server-process)

 (defun command-line ()
@@ -1221,5 +1222,8 @@
       (when (stringp dn) (setq server-name dn))
       (server-start)
-      (daemon-initialized)))
+      (if server-process
+	  (daemon-initialized)
+	(message "Could not start daemon %S" server-name)
+	(kill-emacs 1))))

   ;; Run emacs-session-restore (session management) if started by




  reply	other threads:[~2008-12-16  9:38 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-15  9:00 bug in server-start Nick Roberts
2008-12-15 10:29 ` Juanma Barranquero
2008-12-15 10:50   ` Sven Joachim
2008-12-15 11:03     ` Juanma Barranquero
2008-12-15 11:04   ` Nick Roberts
2008-12-15 11:10     ` Juanma Barranquero
2008-12-15 11:26       ` Juanma Barranquero
2008-12-15 11:59         ` Juanma Barranquero
2008-12-15 15:25     ` Stefan Monnier
2008-12-15 17:24       ` Dan Nicolaescu
2008-12-15 18:27         ` Juanma Barranquero
2008-12-15 19:16           ` Romain Francoise
2008-12-15 20:00           ` Dan Nicolaescu
2008-12-16  7:03           ` Ulrich Mueller
2008-12-16  9:38             ` Juanma Barranquero [this message]
2008-12-16 11:49               ` Ulrich Mueller
2008-12-16 12:15                 ` Juanma Barranquero
2008-12-16 13:43                   ` Ulrich Mueller
2008-12-16 15:40                 ` Stefan Monnier
2008-12-16 16:01                   ` Ulrich Mueller
2008-12-16 16:01               ` Dan Nicolaescu
2008-12-16 16:07                 ` Juanma Barranquero
2008-12-16 16:15                   ` Dan Nicolaescu
2008-12-16 16:20                     ` Juanma Barranquero
2008-12-16 16:31                       ` Dan Nicolaescu
2008-12-16 16:42                         ` Juanma Barranquero
2008-12-16 17:00                           ` Dan Nicolaescu
2008-12-16 18:28                             ` Juanma Barranquero
2008-12-16 18:51                               ` Dan Nicolaescu
2008-12-16 19:00                                 ` Juanma Barranquero
2008-12-16 19:28                                   ` Dan Nicolaescu
2008-12-16 19:46                                     ` Juanma Barranquero
2008-12-16 19:58                                       ` Dan Nicolaescu
2008-12-16 20:33                                         ` Juanma Barranquero
2008-12-16 20:59                                           ` Dan Nicolaescu
2008-12-16 21:05                                             ` Juanma Barranquero
2008-12-16 20:56                           ` Chong Yidong
2008-12-16 21:12                             ` Juanma Barranquero
2008-12-16 23:44                   ` Stefan Monnier
2008-12-15 20:12         ` Stefan Monnier
2008-12-16 14:55           ` Dan Nicolaescu
2008-12-16 15:36             ` Stefan Monnier
2008-12-16 15:56               ` Dan Nicolaescu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f7ccd24b0812160138i7d3e26d4tb1061ee7e41bc676@mail.gmail.com \
    --to=lekktu@gmail.com \
    --cc=dann@ics.uci.edu \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=nickrob@snap.net.nz \
    --cc=ulm@gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).