From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#1474: 23.0.60; desktop.el don't check if pid in his lock file is always in use Date: Sat, 08 Feb 2020 17:20:00 +0200 Message-ID: <83v9ohcdi7.fsf@gnu.org> References: <87bpvufe28.fsf@tux.homenetwork> <87v9p094ym.fsf@marxist.se> <87eev56tuu.fsf@marxist.se> Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="12529"; mail-complaints-to="usenet@ciao.gmane.io" Cc: thierry.volpiatto@gmail.com, 1474@debbugs.gnu.org, emacs@gentoo.org To: Stefan Kangas Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Feb 08 16:21:14 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1j0Rv0-00039Q-5f for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 08 Feb 2020 16:21:14 +0100 Original-Received: from localhost ([::1]:42616 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j0Ruy-0007bm-86 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 08 Feb 2020 10:21:12 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36263) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j0Rup-0007Z0-Np for bug-gnu-emacs@gnu.org; Sat, 08 Feb 2020 10:21:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j0Ruo-0001tu-J7 for bug-gnu-emacs@gnu.org; Sat, 08 Feb 2020 10:21:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:45740) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j0Ruo-0001tB-F2 for bug-gnu-emacs@gnu.org; Sat, 08 Feb 2020 10:21:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1j0Ruo-0007XJ-AH for bug-gnu-emacs@gnu.org; Sat, 08 Feb 2020 10:21:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 08 Feb 2020 15:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 1474 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 1474-submit@debbugs.gnu.org id=B1474.158117523728919 (code B ref 1474); Sat, 08 Feb 2020 15:21:02 +0000 Original-Received: (at 1474) by debbugs.gnu.org; 8 Feb 2020 15:20:37 +0000 Original-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 Original-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 Original-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 Original-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 In-reply-to: <87eev56tuu.fsf@marxist.se> (message from Stefan Kangas on Sat, 08 Feb 2020 15:23:21 +0100) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:175799 Archived-At: > 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.