From thierry.volpiatto@gmail.com Tue Dec 2 13:48:50 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-5.9 required=4.0 tests=BAYES_00,FOURLA, MURPHY_DRUGS_REL8,PUSSY,RCVD_IN_DNSWL_MED autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at submit) by emacsbugs.donarmstrong.com; 2 Dec 2008 21:48:50 +0000 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mB2LmkbX009400 for ; Tue, 2 Dec 2008 13:48:47 -0800 Received: from mx10.gnu.org ([199.232.76.166]:40954) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1L7d6R-0004Yd-5f for emacs-pretest-bug@gnu.org; Tue, 02 Dec 2008 16:48:19 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1L7d6q-00072d-40 for emacs-pretest-bug@gnu.org; Tue, 02 Dec 2008 16:48:45 -0500 Received: from gv-out-0910.google.com ([216.239.58.189]:31721) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1L7d6p-00072J-JC for emacs-pretest-bug@gnu.org; Tue, 02 Dec 2008 16:48:43 -0500 Received: by gv-out-0910.google.com with SMTP id i36so685309gve.17 for ; Tue, 02 Dec 2008 13:48:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date :message-id:user-agent:mime-version:content-type; bh=w9RmEsgbh2s5uLdnInR2+cvWwXmdingQ0f1povXezY8=; b=s2r63Dc7/meba8NLFWNH2dOcWP/4FnYAQrLLPKhSZbtNgQRlC7DKLtlGJ8+sxbCxRr NzMkqUX943gyydqE6B+brBJj1Ac9APmrozpVPVPyQMKzLAD7/+XV0x2B+wvoEAJU94hr BJZY2codAIv2qVp+k8s8E1qeBF1BAi6B/aQFw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:user-agent:mime-version :content-type; b=R0+czhij4mYN6ZHMSsZr/EutiNVjxVpgUd0cHS/wCV0G5rbsFUAMCq/rP/UI4CZjBC zB3ea8sUBat/VCm/yB9ixaG4DawJkzAB/0NNdNVVWJmozStQfNPcBCtCF4J0NydpXKn2 5/TRwPs9IE33gdRBtkFqGdOAdvgTmP7SLPIt4= Received: by 10.103.252.17 with SMTP id e17mr5590667mus.14.1228254520212; Tue, 02 Dec 2008 13:48:40 -0800 (PST) Received: from tux.homenetwork (49.78.88-79.rev.gaoland.net [79.88.78.49]) by mx.google.com with ESMTPS id 7sm8647735mup.24.2008.12.02.13.48.39 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 02 Dec 2008 13:48:39 -0800 (PST) From: Thierry Volpiatto To: emacs-pretest-bug@gnu.org Cc: emacs@gentoo.org Subject: 23.0.60; desktop.el don't check if pid in his lock file is always in use Date: Tue, 02 Dec 2008 22:43:43 +0100 Message-ID: <87bpvufe28.fsf@tux.homenetwork> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Please write in English if possible, because the Emacs maintainers usually do not have translators to read other languages for them. Your bug report will be posted to the emacs-pretest-bug@gnu.org mailing list. Please describe exactly what actions triggered the bug and the precise symptoms of the bug: When killing emacs --daemon or emacs brutally with killall for example, when reloading emacs or emacs --daemon, emacs ask if we want to load desktop file or not (pid is already in use...). I think emacs should check if the PID that is in his lock file is always in use. i made a quick hack for that: That go after line 967 in desktop.el in function desktop-read. ,---- | (eq 0 (call-process-shell-command (format "ps -u %s | grep emacs | grep %d" (getenv "USER") owner))) `---- I can make a patch if you want, just tell me. This bug is not really a bug if we consider using emacs normally: we have just to answer yes or no. But that particularly anoying with new feature emacs --daemon. If this one is started as a service it can hang the system and booting the machine come impossible until file .emacs.desktop.lock is removed. (Gentoo provide an init script to start emacs --daemon as service with openrc) Thank you. Thierry 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'. If you would like to further debug the crash, please read the file /usr/share/emacs/23.0.60/etc/DEBUG for instructions. In GNU Emacs 23.0.60.1 (i686-pc-linux-gnu, GTK+ Version 2.14.5) of 2008-12-02 on tux Windowing system distributor `The X.Org Foundation', version 11.0.10300000 configured using `configure '--prefix=/usr' '--host=i686-pc-linux-gnu' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--datadir=/usr/share' '--sysconfdir=/etc' '--localstatedir=/var/lib' '--program-suffix=-emacs-23' '--infodir=/usr/share/info/emacs-23' '--with-sound' '--with-x' '--without-toolkit-scroll-bars' '--with-gif' '--with-jpeg' '--with-png' '--with-rsvg' '--with-tiff' '--with-xpm' '--with-freetype' '--with-xft' '--without-libotf' '--without-m17n-flt' '--with-x-toolkit=gtk' '--without-hesiod' '--without-kerberos' '--without-kerberos5' '--with-gpm' '--with-dbus' '--build=i686-pc-linux-gnu' 'build_alias=i686-pc-linux-gnu' 'host_alias=i686-pc-linux-gnu' 'CFLAGS=-march=i686 -pipe -O2' 'LDFLAGS=-Wl,-O1'' Important settings: value of $LC_ALL: fr_FR.UTF-8 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: fr_FR.UTF-8 value of $XMODIFIERS: nil locale-coding-system: utf-8-unix default-enable-multibyte-characters: t Major mode: ERC Minor modes in effect: erc-list-mode: t erc-menu-mode: t erc-autojoin-mode: t erc-ring-mode: t erc-networks-mode: t erc-pcomplete-mode: t erc-track-mode: t erc-track-minor-mode: t erc-match-mode: t erc-button-mode: t erc-fill-mode: t erc-stamp-mode: t erc-netsplit-mode: t erc-irccontrols-mode: t erc-noncommands-mode: t erc-move-to-prompt-mode: t erc-readonly-mode: t icomplete-mode: t icicle-mode: t delete-selection-mode: t minibuffer-depth-indicate-mode: t auto-image-file-mode: t partial-completion-mode: t shell-dirtrack-mode: t display-wireless-mode: t display-battery-mode: t display-time-mode: t diff-auto-refine-mode: t recentf-mode: t savehist-mode: t desktop-save-mode: t tooltip-mode: t mouse-wheel-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: m e ! ) C-e A n y SPC w a y SPC i SPC w i l l SPC s u b m i t SPC a SPC b u g SPC a l s o . T h a n k s . g m a n e . . C-SPC C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-x r s a C-g C-g C-c C-c y q q n q q q y h k B s t : H i ! SPC M-x e m a c s - s u b m i b u g b u g C-g M-x r e p o r t - e b u g Recent messages: Scoring...done Generating summary...done No more unread articles No more unread newsgroups Are you sure you want to quit reading news? (y or n) Wrote /home/thierry/.newsrc Saving /home/thierry/.newsrc.eld... Wrote /home/thierry/.newsrc.eld Saving /home/thierry/.newsrc.eld...done Computing completion candidates... [5 times] -- A + Thierry Volpiatto Location: Saint-Cyr-Sur-Mer - France From lekktu@gmail.com Tue Dec 2 14:39:57 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-6.5 required=4.0 tests=AWL,BAYES_00,FOURLA,GMAIL, HAS_BUG_NUMBER,PUSSY,RCVD_IN_DNSWL_MED autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at submit) by emacsbugs.donarmstrong.com; 2 Dec 2008 22:39:58 +0000 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mB2Mdti5022285 for ; Tue, 2 Dec 2008 14:39:56 -0800 Received: from mx10.gnu.org ([199.232.76.166]:42454) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1L7dtw-00066p-Hm for emacs-pretest-bug@gnu.org; Tue, 02 Dec 2008 17:39:28 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1L7duL-0003Hs-UW for emacs-pretest-bug@gnu.org; Tue, 02 Dec 2008 17:39:54 -0500 Received: from an-out-0708.google.com ([209.85.132.245]:24213) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1L7duL-0003Hm-NA for emacs-pretest-bug@gnu.org; Tue, 02 Dec 2008 17:39:53 -0500 Received: by an-out-0708.google.com with SMTP id c38so3430290ana.21 for ; Tue, 02 Dec 2008 14:39:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=1mnNQmZ7JmOjmJM2TmCHL6+0dP+zSsPmvq9qzcKpN0k=; b=V92QTkVPK3jBrqaqU2f8JZtgGbhN/B+aBiKGX6va7aH5ju8nJWzzrAEbfgoi7tMlZF uvRegPviK67I88AwS94Km6mrXK4012VfRN0sd9/LCcSF0x6A3s/z+jSVjKtwar3/t/rv fJ1iyhmKiaMeLIz6THMlk45PhTSIptpsqbD0s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=MUsYhwh2whYwyA7CGrP6zAF9DJCdy34zPB2VBy0TYjKjC1GhmXSG+F7HYUiHqt6JwX BvYZ80sJ9bBTq+E6bcS3u6e0XpIR4TN20GotrJ8nyFO/pH0qJ3YfRMVDQBDJP68OThVD 9CmQozdSdqZweL7ok3Cd7vW1g0CRpIUuQui00= Received: by 10.101.68.19 with SMTP id v19mr7216992ank.62.1228257592527; Tue, 02 Dec 2008 14:39:52 -0800 (PST) Received: by 10.100.13.13 with HTTP; Tue, 2 Dec 2008 14:39:52 -0800 (PST) Message-ID: Date: Tue, 2 Dec 2008 23:39:52 +0100 From: "Juanma Barranquero" To: "Thierry Volpiatto" , 1474@debbugs.gnu.org Subject: Re: bug#1474: 23.0.60; desktop.el don't check if pid in his lock file is always in use Cc: emacs-pretest-bug@gnu.org, emacs@gentoo.org In-Reply-To: <87bpvufe28.fsf@tux.homenetwork> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <87bpvufe28.fsf@tux.homenetwork> X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-CrossAssassin-Score: 2 On Tue, Dec 2, 2008 at 22:43, Thierry Volpiatto wrote: > | (eq 0 (call-process-shell-command (format "ps -u %s | grep emacs | grep %d" (getenv "USER") owner))) In Emacs 23.X I think you could use `system-process-attributes' instead of running an external ps process. But one way or the other, what if the desktop lock file resides in a non-local drive? Juanma From monnier@IRO.UMontreal.CA Tue Dec 2 14:52:34 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-7.6 required=4.0 tests=AWL,BAYES_00,HAS_BUG_NUMBER, PUSSY,RCVD_IN_DNSWL_MED autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at submit) by emacsbugs.donarmstrong.com; 2 Dec 2008 22:52:34 +0000 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mB2MqVSP025920 for ; Tue, 2 Dec 2008 14:52:32 -0800 Received: from mx10.gnu.org ([199.232.76.166]:42775) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1L7e68-0006Se-LH for emacs-pretest-bug@gnu.org; Tue, 02 Dec 2008 17:52:04 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1L7e6X-0004LQ-S0 for emacs-pretest-bug@gnu.org; Tue, 02 Dec 2008 17:52:30 -0500 Received: from chene.dit.umontreal.ca ([132.204.246.20]:39364) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1L7e6X-0004LE-GS for emacs-pretest-bug@gnu.org; Tue, 02 Dec 2008 17:52:29 -0500 Received: from alfajor.home (vpn-132-204-232-176.acd.umontreal.ca [132.204.232.176]) by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id mB2MqBxK025943; Tue, 2 Dec 2008 17:52:11 -0500 Received: by alfajor.home (Postfix, from userid 20848) id AC0BC1C1D9; Tue, 2 Dec 2008 17:52:11 -0500 (EST) From: Stefan Monnier To: Thierry Volpiatto Cc: 1474@debbugs.gnu.org, emacs-pretest-bug@gnu.org, emacs@gentoo.org Subject: Re: bug#1474: 23.0.60; desktop.el don't check if pid in his lock file is always in use Message-ID: References: <87bpvufe28.fsf@tux.homenetwork> Date: Tue, 02 Dec 2008 17:52:11 -0500 In-Reply-To: <87bpvufe28.fsf@tux.homenetwork> (Thierry Volpiatto's message of "Tue, 02 Dec 2008 22:43:43 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV3160=0 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-CrossAssassin-Score: 2 > (Gentoo provide an init script to start emacs --daemon as service with openrc) That sounds "brain-dead" since Emacs is not useful to the system, only to its users. Stefan From ulm@kph.uni-mainz.de Tue Dec 2 15:07:17 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-6.1 required=4.0 tests=AWL,BAYES_00,HAS_BUG_NUMBER, PUSSY,RCVD_IN_DNSWL_MED autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at submit) by emacsbugs.donarmstrong.com; 2 Dec 2008 23:07:17 +0000 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mB2N7ExI030336 for ; Tue, 2 Dec 2008 15:07:16 -0800 Received: from mail.gnu.org ([199.232.76.166]:43153 helo=mx10.gnu.org) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1L7eKO-0006zQ-3v for emacs-pretest-bug@gnu.org; Tue, 02 Dec 2008 18:06:48 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1L7eKm-0005im-Qp for emacs-pretest-bug@gnu.org; Tue, 02 Dec 2008 18:07:13 -0500 Received: from a1iwww1.kph.uni-mainz.de ([134.93.134.1]:53227) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1L7eKm-0005iL-E6 for emacs-pretest-bug@gnu.org; Tue, 02 Dec 2008 18:07:12 -0500 Received: from a1ihome1.kph.uni-mainz.de (a1ihome1.kph.uni-mainz.de [134.93.134.75]) by a1iwww1.kph.uni-mainz.de (8.14.0/8.13.4) with ESMTP id mB2N70Ns024098; Wed, 3 Dec 2008 00:07:00 +0100 Received: from a1ihome1.kph.uni-mainz.de (localhost [127.0.0.1]) by a1ihome1.kph.uni-mainz.de (8.14.0/8.14.1) with ESMTP id mB2N70rX001729; Wed, 3 Dec 2008 00:07:00 +0100 Received: (from ulm@localhost) by a1ihome1.kph.uni-mainz.de (8.14.0/8.14.0/Submit) id mB2N70IZ001724; Wed, 3 Dec 2008 00:07:00 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <18741.49043.845780.297156@a1ihome1.kph.uni-mainz.de> Date: Wed, 3 Dec 2008 00:06:59 +0100 To: Stefan Monnier Cc: Thierry Volpiatto , emacs-pretest-bug@gnu.org, emacs@gentoo.org Subject: Re: bug#1474: 23.0.60; desktop.el don't check if pid in his lock file is always in use In-Reply-To: References: <87bpvufe28.fsf@tux.homenetwork> X-Mailer: VM 8.0.2-487 under Emacs 22.2.1 (i686-pc-linux-gnu) From: Ulrich Mueller X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 1) >>>>> On Tue, 02 Dec 2008, Stefan Monnier wrote: >> (Gentoo provide an init script to start emacs --daemon as service >> with openrc) > That sounds "brain-dead" since Emacs is not useful to the system, > only to its users. Of course the rc script has a multiplexed configuration, so that the started Emacs daemons will run under the users' id. Otherwise it wouldn't make much sense. Ulrich From thierry.volpiatto@gmail.com Tue Dec 2 22:35:28 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-7.1 required=4.0 tests=AWL,BAYES_00,FOURLA, HAS_BUG_NUMBER,PUSSY,RCVD_IN_DNSWL_MED autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at submit) by emacsbugs.donarmstrong.com; 3 Dec 2008 06:35:28 +0000 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mB36ZP8T016561 for ; Tue, 2 Dec 2008 22:35:26 -0800 Received: from mail.gnu.org ([199.232.76.166]:54751 helo=mx10.gnu.org) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1L7lK6-0003VU-2N for emacs-pretest-bug@gnu.org; Wed, 03 Dec 2008 01:34:58 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1L7lKV-00016X-TU for emacs-pretest-bug@gnu.org; Wed, 03 Dec 2008 01:35:24 -0500 Received: from nf-out-0910.google.com ([64.233.182.189]:2033) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1L7lKV-00016Q-Ej for emacs-pretest-bug@gnu.org; Wed, 03 Dec 2008 01:35:23 -0500 Received: by nf-out-0910.google.com with SMTP id c7so2036495nfi.26 for ; Tue, 02 Dec 2008 22:35:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:references :date:in-reply-to:message-id:user-agent:mime-version:content-type; bh=tDfV7DzoKNzSNs5sSkPmLZsbdA/pi3G6CHefZOFyP6A=; b=bZcq6nfRG95a3rFV+kMC1/QZwq5TmKHOL4C8NKQqrdrW/BG978KwOUaljUpqgLFAKx SYIPYMG+4+EF+bnT4pwO5UyPpNvj9LSDLajhY4aQB7GyiuZlMyAeySw9e0cyberThLbF 0wIWdvLi9oyI/6oiTdtcWYk0cLFLRb5rqX7Ek= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; b=uNV93VsGG0Mh5QPv+ocG0PTap2JMM5mT9QR9B1gdSCxVfCnoXqDv51ZAgMhzeWDsjI xLBRYEvor3dglQ+m3jIAI+qr4P+v5EWHcnDfoVtFJ+L0qj9LK1xf3Oe4Ky2ZwUXLuJ6N axjtyVdtL+8brsU93OiCotLMVH+YCB8MSr+RI= Received: by 10.103.248.17 with SMTP id a17mr5745140mus.97.1228286121581; Tue, 02 Dec 2008 22:35:21 -0800 (PST) Received: from tux.homenetwork (49.78.88-79.rev.gaoland.net [79.88.78.49]) by mx.google.com with ESMTPS id i7sm6468914mue.45.2008.12.02.22.35.20 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 02 Dec 2008 22:35:21 -0800 (PST) From: Thierry Volpiatto To: Stefan Monnier Cc: 1474@debbugs.gnu.org, emacs-pretest-bug@gnu.org, emacs@gentoo.org Subject: Re: bug#1474: 23.0.60; desktop.el don't check if pid in his lock file is always in use References: <87bpvufe28.fsf@tux.homenetwork> Date: Wed, 03 Dec 2008 07:30:26 +0100 In-Reply-To: (Stefan Monnier's message of "Tue, 02 Dec 2008 17:52:11 -0500") Message-ID: <874p1llqil.fsf@tux.homenetwork> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-CrossAssassin-Score: 2 Stefan Monnier writes: >> (Gentoo provide an init script to start emacs --daemon as service with openrc) > > That sounds "brain-dead" since Emacs is not useful to the system, only > to its users. The init script is started in a by user process with a symlink, in the same manner as net.eth1 is a symlink of net.lo. So the init script is started as /etc/init.d/emacs. and the process is started as . That's a concept, it's interesting, and can interest other users. -- A + Thierry Volpiatto Location: Saint-Cyr-Sur-Mer - France From thierry.volpiatto@gmail.com Tue Dec 2 22:41:55 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-6.9 required=4.0 tests=AWL,BAYES_00,FOURLA,GMAIL, HAS_BUG_NUMBER,PUSSY,RCVD_IN_DNSWL_MED autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at submit) by emacsbugs.donarmstrong.com; 3 Dec 2008 06:41:56 +0000 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mB36frc0017942 for ; Tue, 2 Dec 2008 22:41:54 -0800 Received: from mx10.gnu.org ([199.232.76.166]:54863) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1L7lQM-0003bS-0m for emacs-pretest-bug@gnu.org; Wed, 03 Dec 2008 01:41:26 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1L7lQl-0001Sz-TS for emacs-pretest-bug@gnu.org; Wed, 03 Dec 2008 01:41:52 -0500 Received: from fk-out-0910.google.com ([209.85.128.190]:13289) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1L7lQl-0001Sl-F4 for emacs-pretest-bug@gnu.org; Wed, 03 Dec 2008 01:41:51 -0500 Received: by fk-out-0910.google.com with SMTP id 18so2893185fkq.10 for ; Tue, 02 Dec 2008 22:41:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:references :date:in-reply-to:message-id:user-agent:mime-version:content-type; bh=4aGOXuSwoEphyuFICZP1TZZkez1YpARknNUs2wmEgR8=; b=i+38qhUpu+Td0kvMCfqCI7EVdeIz8yd+T/wAnhcBECit1v6m3LHKcO4OoeSecoyEs5 iHVViYmtlP2Epxs9L6BUPJXBmaE92F/f1oGS9f1doSFI6pye4KdSJhfGIM2QY/vnMHA7 H+fjsydYimQ1kkJDHT2bZj09jTEJF+z2ALiV8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; b=FoPWSFCxRFjyowh3VPbtueJsC8kQGIo5RjWh5of/tZou2oMF9yBUKEpT/0/AjkyWzn UIFDwKCtkFn2pveP+8VwclNyfQAH8RmjMaOrKAep8yQV9kdO4oKy5RnO+tZVskVBum2J 37Bq1wMF80mrUd6yrxv3dvByxElYvlavWwMLQ= Received: by 10.103.218.19 with SMTP id v19mr5755998muq.46.1228286509493; Tue, 02 Dec 2008 22:41:49 -0800 (PST) Received: from tux.homenetwork (49.78.88-79.rev.gaoland.net [79.88.78.49]) by mx.google.com with ESMTPS id 23sm11813955mun.58.2008.12.02.22.41.48 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 02 Dec 2008 22:41:49 -0800 (PST) From: Thierry Volpiatto To: "Juanma Barranquero" Cc: 1474@debbugs.gnu.org, emacs-pretest-bug@gnu.org, emacs@gentoo.org Subject: Re: bug#1474: 23.0.60; desktop.el don't check if pid in his lock file is always in use References: <87bpvufe28.fsf@tux.homenetwork> Date: Wed, 03 Dec 2008 07:36:53 +0100 In-Reply-To: (Juanma Barranquero's message of "Tue, 2 Dec 2008 23:39:52 +0100") Message-ID: <87zljdkbne.fsf@tux.homenetwork> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-CrossAssassin-Score: 2 "Juanma Barranquero" writes: > On Tue, Dec 2, 2008 at 22:43, Thierry Volpiatto > wrote: > >> | (eq 0 (call-process-shell-command (format "ps -u %s | grep emacs | grep %d" (getenv "USER") owner))) > > In Emacs 23.X I think you could use `system-process-attributes' > instead of running an external ps process. Yes, here is the code that can be used in desktop.el: ,---- | (and (system-process-attributes owner) | (string-match "emacs" | (cdr (assq 'comm | (system-process-attributes owner))))) `---- > But one way or the other, what if the desktop lock file resides in a > non-local drive? If emacs process number doesn't exist, the "else" block is used. -- A + Thierry Volpiatto Location: Saint-Cyr-Sur-Mer - France From lekktu@gmail.com Wed Dec 3 00:25:11 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-7.0 required=4.0 tests=AWL,BAYES_00,GMAIL, HAS_BUG_NUMBER,PUSSY,RCVD_IN_DNSWL_MED autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at submit) by emacsbugs.donarmstrong.com; 3 Dec 2008 08:25:11 +0000 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mB38P86Q011689 for ; Wed, 3 Dec 2008 00:25:09 -0800 Received: from mx10.gnu.org ([199.232.76.166]:56705) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1L7n2H-0002il-4J for emacs-pretest-bug@gnu.org; Wed, 03 Dec 2008 03:24:41 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1L7n2e-0008CW-WF for emacs-pretest-bug@gnu.org; Wed, 03 Dec 2008 03:25:07 -0500 Received: from yx-out-1718.google.com ([74.125.44.152]:28143) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1L7n2e-0008CI-NY for emacs-pretest-bug@gnu.org; Wed, 03 Dec 2008 03:25:04 -0500 Received: by yx-out-1718.google.com with SMTP id 34so3104864yxf.66 for ; Wed, 03 Dec 2008 00:25:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=15540KqlGRy6nIgWlM2I4JSgUN6kIRJD7WrMOp3Tzyw=; b=HU76qr4y7LrAqR1XaOdkrwYVsvG8m6DqFzvhl8LIJ80A0hNqMb8xEglWv4YMvCmv3y ifO9UaktLHfchGSxU71vE8Sf7KIvbnfpk9fSv0KiiTCEyiZABSmcb5rce3NIM9EHwaV7 6WEk6j4fi3XQi0vvgQ3qTgUbAPSlClnblLomY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=d7Y3F7HQ3ZJ0WxX8U5I4i/QJ8s1/qYJagKW3bqvH1B/3uNRpaGse+xJu2wD/698B+p Rf98yZBpkS5LGuakRZDFhbzLutm37lSzLvRGUcODDj6S5lTlSluDxatAsC4ZYcVt+uEO 8awrYiuqqgWl0Ce5UZXSPJPmisfDpFbp3/6d8= Received: by 10.100.136.18 with SMTP id j18mr7461525and.103.1228292701720; Wed, 03 Dec 2008 00:25:01 -0800 (PST) Received: by 10.100.13.13 with HTTP; Wed, 3 Dec 2008 00:25:01 -0800 (PST) Message-ID: Date: Wed, 3 Dec 2008 09:25:01 +0100 From: "Juanma Barranquero" To: "Thierry Volpiatto" Subject: Re: bug#1474: 23.0.60; desktop.el don't check if pid in his lock file is always in use Cc: 1474@debbugs.gnu.org, emacs-pretest-bug@gnu.org, emacs@gentoo.org In-Reply-To: <87zljdkbne.fsf@tux.homenetwork> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <87bpvufe28.fsf@tux.homenetwork> <87zljdkbne.fsf@tux.homenetwork> X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-CrossAssassin-Score: 2 On Wed, Dec 3, 2008 at 07:36, Thierry Volpiatto wrote: > If emacs process number doesn't exist, the "else" block is used. Please explain: if the desktop file that Emacs finds out is locked by a process running in another computer, what do you want the local Emacs to do? Juanma From thierry.volpiatto@gmail.com Wed Dec 3 00:52:56 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-7.1 required=4.0 tests=AWL,BAYES_00,GMAIL, HAS_BUG_NUMBER,PUSSY,RCVD_IN_DNSWL_MED autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at submit) by emacsbugs.donarmstrong.com; 3 Dec 2008 08:52:56 +0000 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mB38qrfU018788 for ; Wed, 3 Dec 2008 00:52:54 -0800 Received: from mx10.gnu.org ([199.232.76.166]:57766) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1L7nT7-0002IR-Uh for emacs-pretest-bug@gnu.org; Wed, 03 Dec 2008 03:52:26 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1L7nTX-0002kN-Rd for emacs-pretest-bug@gnu.org; Wed, 03 Dec 2008 03:52:52 -0500 Received: from nf-out-0910.google.com ([64.233.182.189]:20437) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1L7nTX-0002kH-FC for emacs-pretest-bug@gnu.org; Wed, 03 Dec 2008 03:52:51 -0500 Received: by nf-out-0910.google.com with SMTP id c7so2056062nfi.26 for ; Wed, 03 Dec 2008 00:52:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:references :date:in-reply-to:message-id:user-agent:mime-version:content-type; bh=X1fr4SzcXW47yqYXI5gkE+QYUYxNh2EBQJNheSiQQ1I=; b=Irwr7zrUIWZtiIRcKI1j3bVDTLUpsS98/JXxyas8h78yMzhhYFB3GJPO+lhwWWgk8s L9YI3SzSMoUvlJmTQ2RnBE/fyJ4Pr4BwC2CFpCHR6UunoJk0T8VzXCpJXu22qDcYPZcJ 2g2vdjtTdkeMaS5QrL5VDePTbsN85yLuXUOAY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; b=SKYec0XfCSAoDp1A6VWNfpuO0hZtamI0hbmY6FYMeqUv8m8zCFQTLvfiBNZQUcrw+l 9n4eRAxVmpilDFp+AJ79R440x7AioPwYGdh0R2g+Sy0zCiBrrRo+CjRlPD5rUwgtP7So J97ejwDps1mnt2HE6htSr2dgN7KHHHC+MIa4U= Received: by 10.103.220.18 with SMTP id x18mr5794057muq.135.1228294370441; Wed, 03 Dec 2008 00:52:50 -0800 (PST) Received: from tux.homenetwork ([79.88.78.49]) by mx.google.com with ESMTPS id e10sm9009628muf.22.2008.12.03.00.52.49 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 03 Dec 2008 00:52:50 -0800 (PST) From: Thierry Volpiatto To: "Juanma Barranquero" Cc: 1474@debbugs.gnu.org, emacs-pretest-bug@gnu.org, emacs@gentoo.org Subject: Re: bug#1474: 23.0.60; desktop.el don't check if pid in his lock file is always in use References: <87bpvufe28.fsf@tux.homenetwork> <87zljdkbne.fsf@tux.homenetwork> Date: Wed, 03 Dec 2008 09:47:54 +0100 In-Reply-To: (Juanma Barranquero's message of "Wed, 3 Dec 2008 09:25:01 +0100") Message-ID: <87ej0pve4l.fsf@tux.homenetwork> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) "Juanma Barranquero" writes: > On Wed, Dec 3, 2008 at 07:36, Thierry Volpiatto > wrote: > >> If emacs process number doesn't exist, the "else" block is used. > > Please explain: if the desktop file that Emacs finds out is locked by > a process running in another computer, what do you want the local > Emacs to do? I am sorry but I don't understand why emacs would find a process on another computer. In which case ? I just want emacs to check if the process that is in the lock file is own by another emacs process. * If no emacs process with this pid is found ==> load desktop * If an emacs process with this pid is found ==> ask (default) if we load desktop or not Actually when the .emacs.desktop.lock is found, emacs lock desktop and ask if we want to use the desktop file, even if the pid that is in the file is no more in use by an emacs session. Emacs should do that only if user start a second emacs session, in this case the lock file will do his work and tell user this desktop is already in use. To reproduce, start emacs with (desktop-save 1) in your .emacs open some buffers, then kill emacs with a killall or similar. Now no emacs process exist right? start emacs again, it will tell you an emacs process is using desktop: thats wrong. I hope it's clear, thanks. -- A + Thierry Volpiatto Location: Saint-Cyr-Sur-Mer - France From ulm@kph.uni-mainz.de Wed Dec 3 01:15:10 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-6.7 required=4.0 tests=AWL,BAYES_00,HAS_BUG_NUMBER, PUSSY,RCVD_IN_DNSWL_MED autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at submit) by emacsbugs.donarmstrong.com; 3 Dec 2008 09:15:10 +0000 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mB39F6pM024755 for ; Wed, 3 Dec 2008 01:15:08 -0800 Received: from mail.gnu.org ([199.232.76.166]:58419 helo=mx10.gnu.org) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1L7nod-0002Vu-Jq for emacs-pretest-bug@gnu.org; Wed, 03 Dec 2008 04:14:39 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1L7np3-0004hQ-Dc for emacs-pretest-bug@gnu.org; Wed, 03 Dec 2008 04:15:05 -0500 Received: from a1iwww1.kph.uni-mainz.de ([134.93.134.1]:41553) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1L7np2-0004hE-Vs for emacs-pretest-bug@gnu.org; Wed, 03 Dec 2008 04:15:05 -0500 Received: from a1ihome1.kph.uni-mainz.de (a1ihome1.kph.uni-mainz.de [134.93.134.75]) by a1iwww1.kph.uni-mainz.de (8.14.0/8.13.4) with ESMTP id mB39Endf010799; Wed, 3 Dec 2008 10:14:49 +0100 Received: from a1ihome1.kph.uni-mainz.de (localhost [127.0.0.1]) by a1ihome1.kph.uni-mainz.de (8.14.0/8.14.1) with ESMTP id mB39En4N020316; Wed, 3 Dec 2008 10:14:49 +0100 Received: (from ulm@localhost) by a1ihome1.kph.uni-mainz.de (8.14.0/8.14.0/Submit) id mB39EnWH020311; Wed, 3 Dec 2008 10:14:49 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <18742.19976.920879.266804@a1ihome1.kph.uni-mainz.de> Date: Wed, 3 Dec 2008 10:14:48 +0100 To: "Juanma Barranquero" Cc: "Thierry Volpiatto" , 1474@debbugs.gnu.org, emacs-pretest-bug@gnu.org, emacs@gentoo.org Subject: Re: bug#1474: 23.0.60; desktop.el don't check if pid in his lock file is always in use In-Reply-To: References: <87bpvufe28.fsf@tux.homenetwork> <87zljdkbne.fsf@tux.homenetwork> X-Mailer: VM 8.0.2-487 under Emacs 22.2.1 (i686-pc-linux-gnu) From: Ulrich Mueller X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 1) X-CrossAssassin-Score: 2 >>>>> On Wed, 3 Dec 2008, Juanma Barranquero wrote: > Please explain: if the desktop file that Emacs finds out is locked > by a process running in another computer, what do you want the local > Emacs to do? So in addition to the process id, the lock file should also contain the host name, so that the most common usage case can be handled. And instead of a lock file with new syntax, couldn't desktop.el use a symlink, identical to what is done for file locking? (Or even use functions "lock-buffer" etc.?) Ulrich From lekktu@gmail.com Wed Dec 3 01:15:20 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-6.6 required=4.0 tests=AWL,BAYES_00,GMAIL, HAS_BUG_NUMBER,PUSSY,RCVD_IN_DNSWL_MED autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at submit) by emacsbugs.donarmstrong.com; 3 Dec 2008 09:15:21 +0000 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mB39FHx7025284 for ; Wed, 3 Dec 2008 01:15:18 -0800 Received: from mail.gnu.org ([199.232.76.166]:58421 helo=mx10.gnu.org) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1L7noo-0002kv-Nu for emacs-pretest-bug@gnu.org; Wed, 03 Dec 2008 04:14:50 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1L7npE-0004iC-Mh for emacs-pretest-bug@gnu.org; Wed, 03 Dec 2008 04:15:17 -0500 Received: from an-out-0708.google.com ([209.85.132.250]:13412) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1L7npE-0004i8-EK for emacs-pretest-bug@gnu.org; Wed, 03 Dec 2008 04:15:16 -0500 Received: by an-out-0708.google.com with SMTP id c38so3573613ana.21 for ; Wed, 03 Dec 2008 01:15:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=BC90XuZjT6uzPdx3FEsXwHtLQjkNn4xXK3XzuqxAXfE=; b=Ydodj6TumMZYBpvl4xdfEaUjoHNnb6ekLp5lBAZI/wyLiwfIjI/ZUVkR59anOCh7+/ /PaiXqU4Ddlpwe+4TzacMzLAWfU0UGOxyPgRWJ3Or5m6dBoV0NHC/U0zybu6UmaDiD3l 8rcDg+RafBEk5f2iE3JY7XamHmSBOjQ2Sz9+U= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=FI0wibqOljV2S6hIc23UIQyBevx0oyFfGju7PMako4wthT2rgANAL8t820bCt/Rqwk My1RJMCFMBg6Ren+1iqYAxVQEK1CKb2dLwToQpz2cSh/1H/oL7qe+pTYhe7wxmx9V4ff epzETSmSyB96rZ0uJIzi2MslLBvTFP88YK5Vw= Received: by 10.100.41.9 with SMTP id o9mr7488515ano.39.1228295716031; Wed, 03 Dec 2008 01:15:16 -0800 (PST) Received: by 10.100.13.13 with HTTP; Wed, 3 Dec 2008 01:15:15 -0800 (PST) Message-ID: Date: Wed, 3 Dec 2008 10:15:15 +0100 From: "Juanma Barranquero" To: "Thierry Volpiatto" Subject: Re: bug#1474: 23.0.60; desktop.el don't check if pid in his lock file is always in use Cc: 1474@debbugs.gnu.org, emacs-pretest-bug@gnu.org, emacs@gentoo.org In-Reply-To: <87ej0pve4l.fsf@tux.homenetwork> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <87bpvufe28.fsf@tux.homenetwork> <87zljdkbne.fsf@tux.homenetwork> <87ej0pve4l.fsf@tux.homenetwork> X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-CrossAssassin-Score: 2 On Wed, Dec 3, 2008 at 09:47, Thierry Volpiatto wrote: > I am sorry but I don't understand why emacs would find a process on > another computer. No, I'm saying that Emacs *won't* find a process in another computer. > In which case ? The user can customize desktop.el so the desktop file (and desktop file lock) are anywhere, even in a shared directory in a remote disk. > I just want emacs to check if the process that is in the lock file is > own by another emacs process. Yes, I understand. And I'm saying that in the presence of distributed filesystems, you cannot guarantee that a desktop lock file in a local disk is owned by a local process, or that a local Emacs is saving the desktop locally. > * If no emacs process with this pid is found ==> load desktop > > * If an emacs process with this pid is found ==> ask (default) if we load > desktop or not > > Actually when the .emacs.desktop.lock is found, emacs lock desktop and > ask if we want to use the desktop file, even if the pid that is in the > file is no more in use by an emacs session. I share the sentiment. In fact, I do exactly that in my .emacs. But the point of the desktop locking mechanism is protecting the user; automatically overwriting the desktop is against that idea. Juanma From lekktu@gmail.com Wed Dec 3 01:16:48 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-7.6 required=4.0 tests=AWL,BAYES_00,HAS_BUG_NUMBER, PUSSY,RCVD_IN_DNSWL_MED autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at submit) by emacsbugs.donarmstrong.com; 3 Dec 2008 09:16:48 +0000 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mB39Gj8F025722 for ; Wed, 3 Dec 2008 01:16:46 -0800 Received: from mail.gnu.org ([199.232.76.166]:58452 helo=mx10.gnu.org) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1L7nqE-0004Qt-Iz for emacs-pretest-bug@gnu.org; Wed, 03 Dec 2008 04:16:18 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1L7nqe-0004os-R9 for emacs-pretest-bug@gnu.org; Wed, 03 Dec 2008 04:16:45 -0500 Received: from yx-out-1718.google.com ([74.125.44.158]:32011) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1L7nqe-0004om-K0 for emacs-pretest-bug@gnu.org; Wed, 03 Dec 2008 04:16:44 -0500 Received: by yx-out-1718.google.com with SMTP id 34so3143583yxf.66 for ; Wed, 03 Dec 2008 01:16:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=J6VPHOoGS+QegDSsXKHUQzwa/iIMGN1XQr3QwkzaMjo=; b=aXhbirNSewTi8t2Y4SfnwLhTFqK3T5qkYZnh2SqiA7snCN5s5XxvBvGH+x1UDkEQW9 13FknIW1zgDPZz3acG+Izik4tO5osPa3h2eGSiXkBPBeNQ1WXSfUPdD1kYxakJ3DUTil ctruQVwYD5umDzcQw1auvF9LRdTS/0zdf5/Ig= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=V14VYRDQG0Ids774Q8/bgYyPfrIY0R/pT16HH8SAJ4GNiWSvU2El9WWWYI7LhfQ0Lq QxWoQ7sN2CG+8B8ZF4XGzkAo12UUjvchXOE762t5B7grl74sx1DG3CQbJIN5ld8iVWLY ajxNo+8YphFY+XBD6sijLuhGkz5od9sTVKqPo= Received: by 10.100.137.12 with SMTP id k12mr7490508and.55.1228295803116; Wed, 03 Dec 2008 01:16:43 -0800 (PST) Received: by 10.100.13.13 with HTTP; Wed, 3 Dec 2008 01:16:43 -0800 (PST) Message-ID: Date: Wed, 3 Dec 2008 10:16:43 +0100 From: "Juanma Barranquero" To: "Ulrich Mueller" Subject: Re: bug#1474: 23.0.60; desktop.el don't check if pid in his lock file is always in use Cc: "Thierry Volpiatto" , 1474@debbugs.gnu.org, emacs-pretest-bug@gnu.org, emacs@gentoo.org In-Reply-To: <18742.19976.920879.266804@a1ihome1.kph.uni-mainz.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <87bpvufe28.fsf@tux.homenetwork> <87zljdkbne.fsf@tux.homenetwork> <18742.19976.920879.266804@a1ihome1.kph.uni-mainz.de> X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-CrossAssassin-Score: 2 On Wed, Dec 3, 2008 at 10:14, Ulrich Mueller wrote: > So in addition to the process id, the lock file should also contain > the host name, so that the most common usage case can be handled. That's an idea worth pursuing. > And instead of a lock file with new syntax, couldn't desktop.el use a > symlink, identical to what is done for file locking? (Or even use > functions "lock-buffer" etc.?) Only if you want to remove functionality for users of Emacs on Windows. Juanma From thierry.volpiatto@gmail.com Wed Dec 3 02:13:38 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-7.0 required=4.0 tests=AWL,BAYES_00,GMAIL, HAS_BUG_NUMBER,PUSSY,RCVD_IN_DNSWL_MED autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at submit) by emacsbugs.donarmstrong.com; 3 Dec 2008 10:13:38 +0000 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mB3ADZoI007574 for ; Wed, 3 Dec 2008 02:13:36 -0800 Received: from mx10.gnu.org ([199.232.76.166]:60274) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1L7ojE-0002Nl-9D for emacs-pretest-bug@gnu.org; Wed, 03 Dec 2008 05:13:08 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1L7oje-0001pl-6J for emacs-pretest-bug@gnu.org; Wed, 03 Dec 2008 05:13:34 -0500 Received: from nf-out-0910.google.com ([64.233.182.185]:22548) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1L7ojd-0001pd-Ni for emacs-pretest-bug@gnu.org; Wed, 03 Dec 2008 05:13:34 -0500 Received: by nf-out-0910.google.com with SMTP id c7so2072963nfi.26 for ; Wed, 03 Dec 2008 02:13:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:references :date:in-reply-to:message-id:user-agent:mime-version:content-type; bh=DRucrDOO5DL9mrsmsc+54FdCtr8JRHFAPmLaH60VmWI=; b=oa5ybHYVgNULpa+WApwmTe+KCdsMbTSFZpPycVx9cKkMYdovP1bXCIKQSJAJ4kQEyF ec/ntc5j4wIJAl44hvFAtTOfw+GziRSt5Wt7rdrespvICpf+TQoRs3JV7wjW9+5fMpJr PxFelQJUwGDqo4aEf/fWjUX2c5ZQy4YQkJ8Vg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; b=tIUT2wK5RDWLQ0EA4Xq0Kx9rvbnpBWtzRueaHqueePT/GZFWS3SnDL6a3Eaa110Hsy wVdz69A90yuYRpdjicC8S8vNFp/eF8eLnrXkpI/bQ9vrCWO8OW5K0xrx0gT2pkp7mJNl gw1KmP+pVpPgmOxCwS/uunKugjRtYH7LJqD28= Received: by 10.210.119.16 with SMTP id r16mr9923225ebc.127.1228299212903; Wed, 03 Dec 2008 02:13:32 -0800 (PST) Received: from tux.homenetwork (49.78.88-79.rev.gaoland.net [79.88.78.49]) by mx.google.com with ESMTPS id 20sm452197eyc.58.2008.12.03.02.13.31 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 03 Dec 2008 02:13:32 -0800 (PST) From: Thierry Volpiatto To: "Juanma Barranquero" Cc: 1474@debbugs.gnu.org, emacs-pretest-bug@gnu.org, emacs@gentoo.org Subject: Re: bug#1474: 23.0.60; desktop.el don't check if pid in his lock file is always in use References: <87bpvufe28.fsf@tux.homenetwork> <87zljdkbne.fsf@tux.homenetwork> <87ej0pve4l.fsf@tux.homenetwork> Date: Wed, 03 Dec 2008 11:08:35 +0100 In-Reply-To: (Juanma Barranquero's message of "Wed, 3 Dec 2008 10:15:15 +0100") Message-ID: <8763m1d10c.fsf@tux.homenetwork> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-CrossAssassin-Score: 2 "Juanma Barranquero" writes: > On Wed, Dec 3, 2008 at 09:47, Thierry Volpiatto > wrote: > >> I am sorry but I don't understand why emacs would find a process on >> another computer. > > No, I'm saying that Emacs *won't* find a process in another computer. > >> In which case ? > > The user can customize desktop.el so the desktop file (and desktop > file lock) are anywhere, even in a shared directory in a remote disk. Ok i understand now. In this case, may be a variable can be set: * Use a remote desktop ==> use the .emacs.desktop.lock like the actual code * Use a local desktop ==> in this case check if pid exist. (i think local desktop is the most common case) >> I just want emacs to check if the process that is in the lock file is >> own by another emacs process. > > Yes, I understand. And I'm saying that in the presence of distributed > filesystems, you cannot guarantee that a desktop lock file in a local > disk is owned by a local process, or that a local Emacs is saving the > desktop locally. > >> * If no emacs process with this pid is found ==> load desktop >> >> * If an emacs process with this pid is found ==> ask (default) if we load >> desktop or not >> >> Actually when the .emacs.desktop.lock is found, emacs lock desktop and >> ask if we want to use the desktop file, even if the pid that is in the >> file is no more in use by an emacs session. > > I share the sentiment. In fact, I do exactly that in my .emacs. > > But the point of the desktop locking mechanism is protecting the user; > automatically overwriting the desktop is against that idea. > > Juanma > -- A + Thierry Volpiatto Location: Saint-Cyr-Sur-Mer - France From lekktu@gmail.com Wed Dec 3 02:20:22 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-7.1 required=4.0 tests=AWL,BAYES_00,GMAIL, HAS_BUG_NUMBER,PUSSY,RCVD_IN_DNSWL_MED autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at submit) by emacsbugs.donarmstrong.com; 3 Dec 2008 10:20:22 +0000 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mB3AKJe8009939 for ; Wed, 3 Dec 2008 02:20:20 -0800 Received: from mail.gnu.org ([199.232.76.166]:60521 helo=mx10.gnu.org) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1L7opk-0001iR-Fe for emacs-pretest-bug@gnu.org; Wed, 03 Dec 2008 05:19:52 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1L7oqA-0002TG-Iy for emacs-pretest-bug@gnu.org; Wed, 03 Dec 2008 05:20:19 -0500 Received: from yw-out-1718.google.com ([74.125.46.155]:42807) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1L7oqA-0002T8-Af for emacs-pretest-bug@gnu.org; Wed, 03 Dec 2008 05:20:18 -0500 Received: by yw-out-1718.google.com with SMTP id 9so3167618ywk.66 for ; Wed, 03 Dec 2008 02:20:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=bmMooYJtxSHmrG62GFjJZLioQNXTGHSp9ccvL4gbEXU=; b=mmJ2xCybFuU22AX7OWlbrBQ0zLpf3QuqJCjFttg4hX+gGpmAUn0k9SVYJdEjf/yz+S flmagvtYh6NITEzPB4lL4TswWcOXLODz4TE7QPiQNfFI5mhAC79I0RY6DvbeZIZefpRY kFqszke9Mwldqg+d2MY0SGVAZTmKTzD2vlBRo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=G1h/xyDnSh12cnAAW1cQwphMl+zYNYNyvmiB0+2C0LtDyW+doYv9zc/74CsbaE4nhs HIGQxWjbZYrw+O82g2MtA6nvop/m8W0aik80uaWv+BkXVzQ22GPfVgIobmk3wzSjxYOF JF52fz9ChE043V/bEF33YoyWkkNkgC3W9Ci2M= Received: by 10.100.138.10 with SMTP id l10mr7523234and.25.1228299617386; Wed, 03 Dec 2008 02:20:17 -0800 (PST) Received: by 10.100.13.13 with HTTP; Wed, 3 Dec 2008 02:20:17 -0800 (PST) Message-ID: Date: Wed, 3 Dec 2008 11:20:17 +0100 From: "Juanma Barranquero" To: "Thierry Volpiatto" Subject: Re: bug#1474: 23.0.60; desktop.el don't check if pid in his lock file is always in use Cc: 1474@debbugs.gnu.org, emacs-pretest-bug@gnu.org, emacs@gentoo.org In-Reply-To: <8763m1d10c.fsf@tux.homenetwork> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <87bpvufe28.fsf@tux.homenetwork> <87zljdkbne.fsf@tux.homenetwork> <87ej0pve4l.fsf@tux.homenetwork> <8763m1d10c.fsf@tux.homenetwork> X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-CrossAssassin-Score: 2 On Wed, Dec 3, 2008 at 11:08, Thierry Volpiatto wrote: > Ok i understand now. > In this case, may be a variable can be set: > > * Use a remote desktop ==> use the .emacs.desktop.lock like the actual > code > > * Use a local desktop ==> in this case check if pid exist. If you have a shared dir in your local disk, it could be used by a remote Emacs; but you know nothing about that Emacs (well, *you* perhaps do know, but the local Emacs does not). > (i think local desktop is the most common case) I agree, but it should work sensibly (and safely) in the uncommon cases too :-) Juanma From monnier@iro.umontreal.ca Wed Dec 3 13:27:57 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-6.7 required=4.0 tests=AWL,BAYES_00,FOURLA, HAS_BUG_NUMBER,PUSSY,RCVD_IN_DNSWL_MED autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at submit) by emacsbugs.donarmstrong.com; 3 Dec 2008 21:27:57 +0000 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mB3LRsKm019197 for ; Wed, 3 Dec 2008 13:27:55 -0800 Received: from mail.gnu.org ([199.232.76.166]:59983 helo=mx10.gnu.org) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1L7zFm-0001Wy-Ct for emacs-pretest-bug@gnu.org; Wed, 03 Dec 2008 16:27:26 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1L7zGB-0001fP-7s for emacs-pretest-bug@gnu.org; Wed, 03 Dec 2008 16:27:53 -0500 Received: from ironport2-out.pppoe.ca ([206.248.154.182]:28537 helo=ironport2-out.teksavvy.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1L7zGB-0001fF-1S for emacs-pretest-bug@gnu.org; Wed, 03 Dec 2008 16:27:51 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av0EAHWINknO+Jkl/2dsb2JhbACBbdB5gn+BIw X-IronPort-AV: E=Sophos;i="4.33,710,1220241600"; d="scan'208";a="30612935" Received: from 206-248-153-37.dsl.teksavvy.com (HELO pastel.home) ([206.248.153.37]) by ironport2-out.teksavvy.com with ESMTP; 03 Dec 2008 16:27:34 -0500 Received: by pastel.home (Postfix, from userid 20848) id 22D568BAF; Wed, 3 Dec 2008 16:27:34 -0500 (EST) From: Stefan Monnier To: Thierry Volpiatto Cc: 1474@debbugs.gnu.org, "Juanma Barranquero" , emacs-pretest-bug@gnu.org, emacs@gentoo.org Subject: Re: bug#1474: 23.0.60; desktop.el don't check if pid in his lock file is always in use Message-ID: References: <87bpvufe28.fsf@tux.homenetwork> <87zljdkbne.fsf@tux.homenetwork> <87ej0pve4l.fsf@tux.homenetwork> Date: Wed, 03 Dec 2008 16:27:34 -0500 In-Reply-To: <87ej0pve4l.fsf@tux.homenetwork> (Thierry Volpiatto's message of "Wed, 03 Dec 2008 09:47:54 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. X-CrossAssassin-Score: 2 > I am sorry but I don't understand why emacs would find a process on > another computer. In which case ? E.g. when the user's HOME directory is shared by NFS? Stefan From rgm@gnu.org Wed Feb 25 19:57:27 2009 Received: (at control) by emacsbugs.donarmstrong.com; 26 Feb 2009 03:57:27 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-2.0 required=4.0 tests=VALID_BTS_CONTROL autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n1Q3vL63009075 for ; Wed, 25 Feb 2009 19:57:23 -0800 Received: from rgm by fencepost.gnu.org with local (Exim 4.67) (envelope-from ) id 1LcXKz-00072r-09; Wed, 25 Feb 2009 22:55:05 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <18854.4760.940911.972299@fencepost.gnu.org> Date: Wed, 25 Feb 2009 22:55:04 -0500 From: Glenn Morris To: control Subject: control message reassign 686 emacs,w32 reassign 1780 emacsbugs.donarmstrong.com severity 2473 wishlist reassign 2468 spam reassign 2469 spam reassign 2471 spam severity 2474 wishlist severity 973 wishlist tags 846 wontfix reassign 1131 emacs,ns severity 1226 minor severity 1253 minor severity 1339 minor tags 1339 moreinfo severity 1474 wishlist severity 1582 minor severity 1646 minor tags 1753 moreinfo reassign 2475 spam From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 12 11:25:50 2017 Received: (at control) by debbugs.gnu.org; 12 Jun 2017 15:25:50 +0000 Received: from localhost ([127.0.0.1]:43631 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dKRDy-0004RF-7a for submit@debbugs.gnu.org; Mon, 12 Jun 2017 11:25:50 -0400 Received: from mail-wr0-f194.google.com ([209.85.128.194]:34562) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dKNty-0007WH-0b for control@debbugs.gnu.org; Mon, 12 Jun 2017 07:52:58 -0400 Received: by mail-wr0-f194.google.com with SMTP id u101so21460477wrc.1 for ; Mon, 12 Jun 2017 04:52:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:message-id:date:user-agent:mime-version :content-transfer-encoding; bh=dU1LOyD2cnCDRxn8GpHKaGgex06QlueQ7S1etksex3A=; b=AFaROiplznc/3waOHDqA4RmOYCSggwtyuSSlQLoqZAiU5DC50oTYRgybuM6jajZBtV SDqoQmg0wJjVOPFfJ0XhCQYAF1AC5GdZpNdmbCCxJDJDjoa6d9c2KxiSKQrH8ZuZN8su J1ci4p/wZRPbBAX7dSN/rcHmVWDhYFWkqKB2Z+BbDfq7sGskLJtNuI6w2OSTxPtiPLn3 kIrcEYifn1N+teB8Q5amnvshazWOnXSokKoPgMVKcR4+Da2nBSqRzWMynuUPdC0mJZ7v tEqFUu7j5WnfgL/MiFcEXA7kvIT2V6e1bDz6fAbA5DB473chsu+GeP+sRxXPd9TUi3OJ WNMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:message-id:date:user-agent:mime-version :content-transfer-encoding; bh=dU1LOyD2cnCDRxn8GpHKaGgex06QlueQ7S1etksex3A=; b=TKixTXO9NP2jGCXfONRYcJbyUQ/NjvMVf3tspPhL91m95HhC8cKeUDEL4AZZ481Odi MW2JLZ8N0viuJ/ZfpsTaushe8fRnsuozyjbgqNvLLIfAOwoiSsG91YxXwFPF3RDr9Ott lsGsXece894it8wCZ1ZhwnST2YvaQrnk0YcQhCIb439qaPOBKf2VUxrYZAXvaNaFktAN BoDw7+rfUnLoP+oVO7NzIXKH55ZPDLPXogH2rCrBZZPdA4zYlnhEWbXlfJI64DickZLr m3l9Ho/K/ZiGjN0ckCsIvNSOZLO+rmIs391JL52WH/aHEmwVTqHLkyYy5HrYK9KGiDbE M0JQ== X-Gm-Message-State: AKS2vOy9mOtP/937P7H0f5ksDz0ZIq1EQdGX4nfnphSMURec/ALOqbiF gkZYbj6MFa7BU7wO X-Received: by 10.28.12.2 with SMTP id 2mr7606924wmm.39.1497268371777; Mon, 12 Jun 2017 04:52:51 -0700 (PDT) Received: from [192.168.0.59] ([78.97.200.10]) by smtp.googlemail.com with ESMTPSA id v72sm16971986wrc.53.2017.06.12.04.52.50 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Jun 2017 04:52:51 -0700 (PDT) From: =?UTF-8?B?SW9udcibIENpb2PDrnJsYW4=?= To: control@debbugs.gnu.org Message-ID: <541026df-d533-80fc-95c2-bfe7319fd0c4@gmail.com> Date: Mon, 12 Jun 2017 14:52:49 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: 2.0 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: merge 1474 25232 [...] Content analysis details: (2.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (ionut.ciocirlan[at]gmail.com) -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.128.194 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [209.85.128.194 listed in list.dnswl.org] 0.0 T_DKIM_INVALID DKIM-Signature header exists but is not valid 1.8 MISSING_SUBJECT Missing Subject: header 0.2 NO_SUBJECT Extra score for no subject X-Debbugs-Envelope-To: control X-Mailman-Approved-At: Mon, 12 Jun 2017 11:25:49 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 2.0 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: merge 1474 25232 [...] Content analysis details: (2.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [209.85.128.194 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.128.194 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (ionut.ciocirlan[at]gmail.com) 0.0 T_DKIM_INVALID DKIM-Signature header exists but is not valid 1.8 MISSING_SUBJECT Missing Subject: header 0.2 NO_SUBJECT Extra score for no subject merge 1474 25232 From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 24 11:47:44 2020 Received: (at 1474) by debbugs.gnu.org; 24 Jan 2020 16:47:45 +0000 Received: from localhost ([127.0.0.1]:54690 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iv27U-0001bV-Cv for submit@debbugs.gnu.org; Fri, 24 Jan 2020 11:47:44 -0500 Received: from ted.gofardesign.uk ([67.225.143.91]:38552) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iv27R-0001bE-Qj; Fri, 24 Jan 2020 11:47:42 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=marxist.se; s=default; h=Content-Type:MIME-Version:Message-ID:Date:References: In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=vQCxccyoBSC9odqKHWEXMc64G+61xn3ztDHApE2MLZU=; b=Xe2esNmpfRCfW6fAl7YIpi3xTV uLmDK2bbAXGLmlW8izorHSvuNJyDUNU+vszIZUok3kDN0v3ofh+gtwczxNgiFbtwW0chGbKIuOlrU 7sw9CcZXv2sZW10DYGg05n0bvqw6gKkRtbJPwhXXp4QwBX7bqDqcaSMnYvOfxvpm4ha+iUwoJLa2j TlOYF4ShtLTZbHDJIZFrP4a+D7jZ8UjvsdBHxAzO+cu+fLwoGwl0a84g4xmVrXzo5JhLHFUcozvug KxCJqoA/kmUUSlkNAnHhZD3JVVunEJD7zpQNFPVZYZDpptrolE/Do+iaVmEOpldRTK+l99thX5bJK nducRPZQ==; Received: from h-70-69.a785.priv.bahnhof.se ([155.4.70.69]:33248 helo=localhost) by ted.gofardesign.uk with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1iv27H-0015oc-2s; Fri, 24 Jan 2020 11:47:31 -0500 From: Stefan Kangas To: Thierry Volpiatto Subject: Re: bug#1474: 23.0.60; desktop.el don't check if pid in his lock file is always in use In-Reply-To: <87bpvufe28.fsf@tux.homenetwork> (Thierry Volpiatto's message of "Tue, 02 Dec 2008 22:43:43 +0100") References: <87bpvufe28.fsf@tux.homenetwork> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Date: Fri, 24 Jan 2020 17:47:29 +0100 Message-ID: <87v9p094ym.fsf@marxist.se> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - ted.gofardesign.uk X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - marxist.se X-Get-Message-Sender-Via: ted.gofardesign.uk: authenticated_id: stefan@marxist.se X-Authenticated-Sender: ted.gofardesign.uk: stefan@marxist.se X-Source: X-Source-Args: X-Source-Dir: X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 1474 Cc: 1474@debbugs.gnu.org, emacs@gentoo.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain tags 1474 + patch thanks Thierry Volpiatto writes: > When killing emacs --daemon or emacs brutally with killall for example, > when reloading emacs or emacs --daemon, emacs ask if we want to load > desktop file or not (pid is already in use...). > I think emacs should check if the PID that is in his lock file is always > in use. I agree with the proposal, and have written up a suggested patch. This would work as follows (taken from my NEWS entry, see the suggested documentation for more): ** Emacs Sessions (Desktop) +++ *** New option to load if locking Emacs not running locally. The option 'desktop-load-locked-desktop' can now be set to value 'check', which means to load the desktop only if the locking Emacs process is not running on the local machine. See the "(emacs) Saving Emacs Sessions" node in the Emacs manual for details. The concerns with this proposal was that this breaks if Emacs is running on a remote machine. The user could have the lock file in a remoted directory (e.g. on an NFS mount). I have therefore documented in the manual and the doc string that this value should be avoided under such circumstances. Another idea suggested in this thread was to change the lock file to also include (system-name). That could be done, if it's deemed to be better, but has the drawback that a lock file from a recent Emacs would not be recognized by an old Emacs. (The relevant code reads the whole buffer.) A possible work-around is to add the backwards incompatible system name in a comment instead. Maybe that is much more desirable than simply documenting the limitation; it would be good to hear other opinions on that. Any comments or suggestions? Best regards, Stefan Kangas --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Load-desktop-without-prompting-if-process-is-dead.patch >From 04c2d26df4f73be675cc9ea6aa2ce10a474ecd18 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Fri, 24 Jan 2020 05:12:20 +0100 Subject: [PATCH] Load desktop without prompting if process is dead * lisp/desktop.el (desktop-load-locked-desktop): Add new value 'check' to load desktop file without prompting if locking Emacs process does not exist on the local machine. (Bug#1474) (desktop-read): Extract function from here... (desktop--load-locked-desktop-p): ...to here. New function handles the semantics of 'desktop-load-locked-desktop', including above new value 'check'. (desktop--emacs-pid-running-p): New function. * test/lisp/desktop-tests.el: New file with tests for the above. * doc/emacs/misc.texi (Saving Emacs Sessions): Document the new 'check' value. * etc/NEWS: Announce the change. --- doc/emacs/misc.texi | 7 +++++- etc/NEWS | 9 +++++++ lisp/desktop.el | 48 +++++++++++++++++++++++++++--------- test/lisp/desktop-tests.el | 50 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 102 insertions(+), 12 deletions(-) create mode 100644 test/lisp/desktop-tests.el diff --git a/doc/emacs/misc.texi b/doc/emacs/misc.texi index 6b95b12a84..bedbfb7abe 100644 --- a/doc/emacs/misc.texi +++ b/doc/emacs/misc.texi @@ -2653,7 +2653,12 @@ Saving Emacs Sessions can avoid the question by customizing the variable @code{desktop-load-locked-desktop} to either @code{nil}, which means never load the desktop in this case, or @code{t}, which means load the -desktop without asking. +desktop without asking. Finally, the @code{check} value means to load +the file if the Emacs process that has locked the desktop is not +running on the local machine. This should not be used in +circumstances where the locking Emacs might still be running on +another machine. This could be the case in multi-user environments +where your home directory is mounted remotely using NFS or similar. @cindex desktop restore in daemon mode When Emacs starts in daemon mode, it cannot ask you any questions, diff --git a/etc/NEWS b/etc/NEWS index 11ef31b2c8..de39912e90 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -90,6 +90,15 @@ supplied error message. *** New connection method "media", which allows accessing media devices like cell phones, tablets or cameras. +** Emacs Sessions (Desktop) + ++++ +*** New option to load if locking Emacs not running locally. +The option 'desktop-load-locked-desktop' can now be set to value +'check', which means to load the desktop only if the locking Emacs +process is not running on the local machine. See the "(emacs) Saving +Emacs Sessions" node in the Emacs manual for details. + * New Modes and Packages in Emacs 28.1 diff --git a/lisp/desktop.el b/lisp/desktop.el index 9538bb4a34..27f6c80531 100644 --- a/lisp/desktop.el +++ b/lisp/desktop.el @@ -230,16 +230,25 @@ desktop-auto-save-timeout (defcustom desktop-load-locked-desktop 'ask "Specifies whether the desktop should be loaded if locked. Possible values are: - t -- load anyway. - nil -- don't load. - ask -- ask the user. -If the value is nil, or `ask' and the user chooses not to load the desktop, -the normal hook `desktop-not-loaded-hook' is run." + t -- load anyway. + nil -- don't load. + ask -- ask the user. + check -- load if locking Emacs process is missing locally. + +If the value is nil, or `ask' and the user chooses not to load +the desktop, the normal hook `desktop-not-loaded-hook' is run. + +If the value is `check', load the desktop if the Emacs process +that has locked it is not running on the local machine. This +should not be used in circumstances where the locking Emacs might +still be running on another machine. That could be the case if +you have remotely mounted (NFS) paths in `desktop-dirname'." :type '(choice (const :tag "Load anyway" t) (const :tag "Don't load" nil) - (const :tag "Ask the user" ask)) + (const :tag "Ask the user" ask) + (const :tag "Load if no local process" check)) :group 'desktop :version "22.2") @@ -662,6 +671,27 @@ desktop-owner (integerp owner))) owner))) +(defun desktop--emacs-pid-running-p (pid) + "Return t if an Emacs process with PID exists." + (when-let ((attr (process-attributes pid))) + (string-match "^emacs$" (alist-get 'comm attr)))) + +(defun desktop--load-locked-desktop-p (owner) + "Return t if a locked desktop should be loaded. +OWNER is the pid in the lock file. +The return value of this function depends on the value of +`desktop-load-locked-desktop'." + (pcase desktop-load-locked-desktop + ('ask + (unless (daemonp) + (y-or-n-p (format "Warning: desktop file appears to be in use by PID %s.\n\ +Using it may cause conflicts. Use it anyway? " owner)))) + ('check + (or (eq (emacs-pid) owner) + (not (desktop--emacs-pid-running-p owner)))) + ('nil nil) + (_ t))) + (defun desktop-claim-lock (&optional dirname) "Record this Emacs process as the owner of the desktop file in DIRNAME. DIRNAME omitted or nil means use `desktop-dirname'." @@ -1238,11 +1268,7 @@ desktop-read (desktop-save nil) (desktop-autosave-was-enabled)) (if (and owner - (memq desktop-load-locked-desktop '(nil ask)) - (or (null desktop-load-locked-desktop) - (daemonp) - (not (y-or-n-p (format "Warning: desktop file appears to be in use by PID %s.\n\ -Using it may cause conflicts. Use it anyway? " owner))))) + (not (desktop--load-locked-desktop-p owner))) (let ((default-directory desktop-dirname)) (setq desktop-dirname nil) (run-hooks 'desktop-not-loaded-hook) diff --git a/test/lisp/desktop-tests.el b/test/lisp/desktop-tests.el new file mode 100644 index 0000000000..7483bb8adb --- /dev/null +++ b/test/lisp/desktop-tests.el @@ -0,0 +1,50 @@ +;;; desktop-tests.el --- Tests for desktop.el -*- lexical-binding: t -*- + +;; Copyright (C) 2020 Free Software Foundation, Inc. + +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs. If not, see . + +;;; Commentary: + +;;; Code: + +(require 'ert) +(require 'desktop) + +(ert-deftest desktop-tests--emacs-pid-running-p () + (should (desktop--emacs-pid-running-p (emacs-pid))) + (should-not (desktop--emacs-pid-running-p 1))) + +(ert-deftest desktop-tests--load-locked-desktop-p () + (let ((desktop-load-locked-desktop t)) + (should (desktop--load-locked-desktop-p (emacs-pid))))) + +(ert-deftest desktop-tests--load-locked-desktop-p-nil () + (let ((desktop-load-locked-desktop nil)) + (should-not (desktop--load-locked-desktop-p (emacs-pid))))) + +(ert-deftest desktop-tests--load-locked-desktop-p-ask () + (let ((desktop-load-locked-desktop 'ask)) + (cl-letf (((symbol-function 'y-or-n-p) (lambda (&rest _) t))) + (should (desktop--load-locked-desktop-p (emacs-pid)))) + (cl-letf (((symbol-function 'y-or-n-p) (lambda (&rest _) nil))) + (should-not (desktop--load-locked-desktop-p (emacs-pid)))))) + +(ert-deftest desktop-tests--load-locked-desktop-p-check () + (let ((desktop-load-locked-desktop 'check)) + (desktop--load-locked-desktop-p (emacs-pid)))) + +(provide 'desktop-tests) -- 2.20.1 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 08 09:23:32 2020 Received: (at 1474) by debbugs.gnu.org; 8 Feb 2020 14:23:32 +0000 Received: from localhost ([127.0.0.1]:50736 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j0R1A-0003xG-Fp for submit@debbugs.gnu.org; Sat, 08 Feb 2020 09:23:32 -0500 Received: from ted.gofardesign.uk ([67.225.143.91]:46478) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j0R18-0003x0-JR for 1474@debbugs.gnu.org; Sat, 08 Feb 2020 09:23:31 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=marxist.se; s=default; h=Content-Type:MIME-Version:Message-ID:Date:References: In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=3ppuNwROGuvIBnBv0Pg7wcJh+gpw3YGLhrbTR0QrIHk=; b=FSX3ZxSL/Sd79H8+l1V5vvdp+4 Pu8dBiOXcEV5xzGatfdQMsK3hICOminaeC+ZSUrK1zAbwOlf9ph5nJjL9VVH0K67HTQVVlLTZYddf 422pwmdneQxot32OvF4mZ29yirtiyitCc2itN+6rctNjMnyXqbmhJwyYXkoGI6s0C2yYNNiw4M08y 3KuFM6jA+pEdoJadzWxw++ptw7oayLd9ZIxOjkuocY80SCZbqDBsgcKE6C5e8R1p4PvMgYHIo1JSw bqhQAKOrpM7KD7Lfgb4b3J/EkyMarfhYACECc1kpaNUrsiDxCd4o8brSlf5mWheEAbwVz8f6tYMYo IHHJRTQA==; Received: from h-4-70-69.a785.priv.bahnhof.se ([155.4.70.69]:35836 helo=localhost) by ted.gofardesign.uk with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1j0R11-001E3G-PW; Sat, 08 Feb 2020 09:23:24 -0500 From: Stefan Kangas To: Thierry Volpiatto Subject: Re: bug#1474: 23.0.60; desktop.el don't check if pid in his lock file is always in use In-Reply-To: <87v9p094ym.fsf@marxist.se> (Stefan Kangas's message of "Fri, 24 Jan 2020 17:47:29 +0100") References: <87bpvufe28.fsf@tux.homenetwork> <87v9p094ym.fsf@marxist.se> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Date: Sat, 08 Feb 2020 15:23:21 +0100 Message-ID: <87eev56tuu.fsf@marxist.se> MIME-Version: 1.0 Content-Type: text/plain X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - ted.gofardesign.uk X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - marxist.se X-Get-Message-Sender-Via: ted.gofardesign.uk: authenticated_id: stefan@marxist.se X-Authenticated-Sender: ted.gofardesign.uk: stefan@marxist.se X-Source: X-Source-Args: X-Source-Dir: X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 1474 Cc: 1474@debbugs.gnu.org, emacs@gentoo.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Stefan Kangas writes: > I agree with the proposal, and have written up a suggested patch. No comments within 2 weeks. If no one objects within a couple of days, I intend to install this change on master (and consequently close this bug). Please voice any outstanding concerns before that. Thanks. Best regards, Stefan Kangas From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 08 10:20:37 2020 Received: (at 1474) by debbugs.gnu.org; 8 Feb 2020 15:20:37 +0000 Received: from localhost ([127.0.0.1]:51713 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j0RuP-0007WM-3h for submit@debbugs.gnu.org; Sat, 08 Feb 2020 10:20:37 -0500 Received: from eggs.gnu.org ([209.51.188.92]:49201) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j0RuO-0007W8-CW for 1474@debbugs.gnu.org; Sat, 08 Feb 2020 10:20:36 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:46404) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1j0RuI-0000Xn-Bt; Sat, 08 Feb 2020 10:20:30 -0500 Received: from [176.228.60.248] (port=4280 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1j0Ru6-00055C-Hr; Sat, 08 Feb 2020 10:20:28 -0500 Date: Sat, 08 Feb 2020 17:20:00 +0200 Message-Id: <83v9ohcdi7.fsf@gnu.org> From: Eli Zaretskii To: Stefan Kangas In-reply-to: <87eev56tuu.fsf@marxist.se> (message from Stefan Kangas on Sat, 08 Feb 2020 15:23:21 +0100) Subject: Re: bug#1474: 23.0.60; desktop.el don't check if pid in his lock file is always in use References: <87bpvufe28.fsf@tux.homenetwork> <87v9p094ym.fsf@marxist.se> <87eev56tuu.fsf@marxist.se> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 1474 Cc: emacs@gentoo.org, 1474@debbugs.gnu.org, thierry.volpiatto@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > From: Stefan Kangas > Date: Sat, 08 Feb 2020 15:23:21 +0100 > Cc: 1474@debbugs.gnu.org, emacs@gentoo.org > > Stefan Kangas writes: > > > I agree with the proposal, and have written up a suggested patch. > > No comments within 2 weeks. If no one objects within a couple of > days, I intend to install this change on master (and consequently > close this bug). Please voice any outstanding concerns before that. Sorry, I failed to present my comments at the time, so let me do that now: > + t -- load anyway. > + nil -- don't load. > + ask -- ask the user. > + check -- load if locking Emacs process is missing locally. I'd prefer 'check-pid' or maybe 'dead-pid' for this option. "Check" is too general. > +If the value is `check', load the desktop if the Emacs process > +that has locked it is not running on the local machine. This > +should not be used in circumstances where the locking Emacs might > +still be running on another machine. That could be the case if > +you have remotely mounted (NFS) paths in `desktop-dirname'." You are right in mentioning that this should not be used for processes that run on other machines, but how can a user make sure this is not the case? Maybe we should modify the contents of the lock file to include the host where the process was running, like we do with file-locks? Or maybe we should still ask for permission if there's no such process, just with a different text, so that users who are sure they _never_ run Emacs from another system could decide to unlock the file more easily? > +(defun desktop--emacs-pid-running-p (pid) > + "Return t if an Emacs process with PID exists." > + (when-let ((attr (process-attributes pid))) > + (string-match "^emacs$" (alist-get 'comm attr)))) I understand the rationale for the string-match test, but what if the executable file name of Emacs was "transformed", per the '--program-transform-name' option of the configure script? And even if it wasn't transformed, this will not match emacs-XX.YY and emacs.exe. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Mon Apr 27 06:34:22 2020 Received: (at 1474) by debbugs.gnu.org; 27 Apr 2020 10:34:22 +0000 Received: from localhost ([127.0.0.1]:35702 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jT15i-0003PO-6F for submit@debbugs.gnu.org; Mon, 27 Apr 2020 06:34:22 -0400 Received: from ted.gofardesign.uk ([67.225.143.91]:60728) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jT15f-0003PB-WE for 1474@debbugs.gnu.org; Mon, 27 Apr 2020 06:34:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=marxist.se; s=default; h=Content-Type:MIME-Version:Message-ID:Date:References: In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=+gCdLOfQmosLBYvqRF1UmbuNjg7AGaogNK5VSDzs3CY=; b=gH6rCM/D2W8dGoGa2+pYwDyoZo FC3EkgdVkMKyWgVpmBI1retJz6F65uPD4Z1nbcDEN+yL7VlECdpXKZKJrC0IFI+hPouzaZFOtlGxV daojEZzEI+KX2ixuJQFIGhT+M4rNhk/+6FiryH/t1XT3yNr9wCdRrjLGzJ2riYrBjWegyY3kE67Q5 SY3IR3nbJCCWLa+LIYp1EYV0WQj9MCKiX3UtAJLOzX1IZQQjFsrYAXlCXKxPa/HMEYwP5YLwC2Wck FETfJaZlSPSJPDUZmBNghok+UnWsM0v8NV3BDAnDQ/qegzG/dzYywZp1wnrPN58WdCcPz7M0/B/Y8 hFM+5GRA==; Received: from h-4-70-69.a785.priv.bahnhof.se ([155.4.70.69]:59000 helo=localhost) by ted.gofardesign.uk with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1jT15W-001jnu-VN; Mon, 27 Apr 2020 06:34:11 -0400 From: Stefan Kangas To: Eli Zaretskii Subject: Re: bug#1474: 23.0.60; desktop.el don't check if pid in his lock file is always in use In-Reply-To: <83v9ohcdi7.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 08 Feb 2020 17:20:00 +0200") References: <87bpvufe28.fsf@tux.homenetwork> <87v9p094ym.fsf@marxist.se> <87eev56tuu.fsf@marxist.se> <83v9ohcdi7.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Date: Mon, 27 Apr 2020 12:34:08 +0200 Message-ID: <87r1w98bfj.fsf@stefankangas.se> MIME-Version: 1.0 Content-Type: text/plain X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - ted.gofardesign.uk X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - marxist.se X-Get-Message-Sender-Via: ted.gofardesign.uk: authenticated_id: stefan@marxist.se X-Authenticated-Sender: ted.gofardesign.uk: stefan@marxist.se X-Source: X-Source-Args: X-Source-Dir: X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 1474 Cc: thierry.volpiatto@gmail.com, 1474@debbugs.gnu.org, emacs@gentoo.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii writes: > Sorry, I failed to present my comments at the time, so let me do that > now: Thank you kindly for the review. > I'd prefer 'check-pid' or maybe 'dead-pid' for this option. "Check" > is too general. Agreed. > You are right in mentioning that this should not be used for processes > that run on other machines, but how can a user make sure this is not > the case? Maybe we should modify the contents of the lock file to > include the host where the process was running, like we do with > file-locks? OK, I'll get to work on this. > Or maybe we should still ask for permission if there's no > such process, just with a different text, so that users who are sure > they _never_ run Emacs from another system could decide to unlock the > file more easily? The motivation here was to have no prompt at all if we can avoid it. So I think I'll get to work an the above suggestion instead, if that's acceptable. >> +(defun desktop--emacs-pid-running-p (pid) >> + "Return t if an Emacs process with PID exists." >> + (when-let ((attr (process-attributes pid))) >> + (string-match "^emacs$" (alist-get 'comm attr)))) > > I understand the rationale for the string-match test, but what if the > executable file name of Emacs was "transformed", per the > '--program-transform-name' option of the configure script? And even > if it wasn't transformed, this will not match emacs-XX.YY and > emacs.exe. Good point. But would you suggest to use no check at all, or is there some other check we could reasonably use? I assume it is impossible to use the process name due to '--program-transform-name'. Maybe we could think about prompting for the case where the pid exists, but the name doesn't match "^emacs"? The user should know best if this is a renamed process or what. Best regards, Stefan Kangas From debbugs-submit-bounces@debbugs.gnu.org Mon Apr 27 10:50:23 2020 Received: (at 1474) by debbugs.gnu.org; 27 Apr 2020 14:50:23 +0000 Received: from localhost ([127.0.0.1]:37806 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jT55T-0002Is-AK for submit@debbugs.gnu.org; Mon, 27 Apr 2020 10:50:23 -0400 Received: from eggs.gnu.org ([209.51.188.92]:55870) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jT55S-0002Ie-2S for 1474@debbugs.gnu.org; Mon, 27 Apr 2020 10:50:22 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:36966) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jT55L-0007E8-9t; Mon, 27 Apr 2020 10:50:15 -0400 Received: from [176.228.60.248] (port=2771 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jT55K-00009Z-Bb; Mon, 27 Apr 2020 10:50:14 -0400 Date: Mon, 27 Apr 2020 17:50:09 +0300 Message-Id: <83sggp3rvi.fsf@gnu.org> From: Eli Zaretskii To: Stefan Kangas In-Reply-To: <87r1w98bfj.fsf@stefankangas.se> (message from Stefan Kangas on Mon, 27 Apr 2020 12:34:08 +0200) Subject: Re: bug#1474: 23.0.60; desktop.el don't check if pid in his lock file is always in use References: <87bpvufe28.fsf@tux.homenetwork> <87v9p094ym.fsf@marxist.se> <87eev56tuu.fsf@marxist.se> <83v9ohcdi7.fsf@gnu.org> <87r1w98bfj.fsf@stefankangas.se> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 1474 Cc: thierry.volpiatto@gmail.com, 1474@debbugs.gnu.org, emacs@gentoo.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Stefan Kangas > Cc: emacs@gentoo.org, 1474@debbugs.gnu.org, thierry.volpiatto@gmail.com > Date: Mon, 27 Apr 2020 12:34:08 +0200 > > >> +(defun desktop--emacs-pid-running-p (pid) > >> + "Return t if an Emacs process with PID exists." > >> + (when-let ((attr (process-attributes pid))) > >> + (string-match "^emacs$" (alist-get 'comm attr)))) > > > > I understand the rationale for the string-match test, but what if the > > executable file name of Emacs was "transformed", per the > > '--program-transform-name' option of the configure script? And even > > if it wasn't transformed, this will not match emacs-XX.YY and > > emacs.exe. > > Good point. But would you suggest to use no check at all, or is there > some other check we could reasonably use? I assume it is impossible > to use the process name due to '--program-transform-name'. Perhaps you could use the name you find in command-line-args? Note that it might include leading directories, and at least on Windows the directory separator might either be a slash or a backslash, so use of file-name-nondirectory is advised. From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 24 04:25:49 2022 Received: (at 1474) by debbugs.gnu.org; 24 Mar 2022 08:25:50 +0000 Received: from localhost ([127.0.0.1]:46718 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nXImz-0005yr-Mn for submit@debbugs.gnu.org; Thu, 24 Mar 2022 04:25:49 -0400 Received: from quimby.gnus.org ([95.216.78.240]:55808) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nXImy-0005ya-3h; Thu, 24 Mar 2022 04:25:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=PoZLCF1fOy7U3/aro/6EUDHk9WR4o3THq14kXsPTeTQ=; b=KUAOKeGFa+9ZnDV+4bBjz2lXng cgT0IyjZPnFXoM+gJXtF2uq9ylaf+2RfuOF6Cfmz8eAmq1i57kco/je+zrv4riybRGEOb0Ezo20gy DaAUqi2TJZS4573KrS+gkuflioyZi1cJq6pr1NXjGClpfzezC6J7Fe00zzPxzI+E70d8=; Received: from 109.179.236.69.tmi.telenormobil.no ([109.179.236.69] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nXImn-0001BI-I1; Thu, 24 Mar 2022 09:25:40 +0100 From: Lars Ingebrigtsen To: Eli Zaretskii Subject: Re: bug#25232: 24.4; Eliminate - Warning: Desktop file appears to be in use References: <87bpvufe28.fsf@tux.homenetwork> <87v9p094ym.fsf@marxist.se> <87eev56tuu.fsf@marxist.se> <83v9ohcdi7.fsf@gnu.org> <87r1w98bfj.fsf@stefankangas.se> <83sggp3rvi.fsf@gnu.org> Date: Thu, 24 Mar 2022 09:25:35 +0100 In-Reply-To: <83sggp3rvi.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 27 Apr 2020 17:50:09 +0300") Message-ID: <87o81v69kw.fsf_-_@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Eli Zaretskii writes: > Perhaps you could use the name you find in command-line-args? Note > that it might include leading directories, and at least on Windows the > directory separator might either be a slash or a backsla [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP 0.0 TVD_RCVD_IP Message was received from an IP address -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 1474 Cc: 1474@debbugs.gnu.org, 25232@debbugs.gnu.org, Stefan Kangas , emacs@gentoo.org, thierry.volpiatto@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Eli Zaretskii writes: > Perhaps you could use the name you find in command-line-args? Note > that it might include leading directories, and at least on Windows the > directory separator might either be a slash or a backslash, so use of > file-name-nondirectory is advised. I've now applied Stefan's patch to Emacs 29 (adjusting for Eli's comments). There's still the question of altering the desktop format to identify the machine it's running on, but I think Stefan's patch covers most of the issue discussed, if I understand correctly. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 24 04:25:55 2022 Received: (at control) by debbugs.gnu.org; 24 Mar 2022 08:25:55 +0000 Received: from localhost ([127.0.0.1]:46723 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nXIn5-0005zI-5u for submit@debbugs.gnu.org; Thu, 24 Mar 2022 04:25:55 -0400 Received: from quimby.gnus.org ([95.216.78.240]:55820) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nXIn1-0005ye-O4 for control@debbugs.gnu.org; Thu, 24 Mar 2022 04:25:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=SuFfeiBzBxVQAXHXPWcSi+tpka+m/hVidWObC2TuHxw=; b=n1SIfdK5hSurycfCFKgwKX0+JN bx6xBfY0DXABjsRFLg+LNmqRh6PTJXf5iN9DPFFJz8C7sQ/En4WB1Pmpaq3iJ4JMZFITOa4AU0FAq q4UDWjaq06VTmtcx38VX3dAd7NoSra/0CQHC3xGEr9+H6yocU1KAIQsvv96GA+Nt+O0I=; Received: from 109.179.236.69.tmi.telenormobil.no ([109.179.236.69] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nXImt-0001BV-VO for control@debbugs.gnu.org; Thu, 24 Mar 2022 09:25:45 +0100 Date: Thu, 24 Mar 2022 09:25:42 +0100 Message-Id: <87mthf69kp.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #25232 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: close 25232 29.1 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP 0.0 TVD_RCVD_IP Message was received from an IP address -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) close 25232 29.1 quit From unknown Wed Jun 18 23:11:26 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 21 Apr 2022 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator