GNU bug report logs -
#1474
23.0.60; desktop.el don't check if pid in his lock file is always in use
Previous Next
Reported by: Thierry Volpiatto <thierry.volpiatto <at> gmail.com>
Date: Tue, 2 Dec 2008 21:55:04 UTC
Severity: wishlist
Tags: patch
Merged with 25232
Found in version 24.4
Fixed in version 29.1
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
Message #145 received at 1474 <at> debbugs.gnu.org (full text, mbox):
> From: Stefan Kangas <stefan <at> marxist.se>
> Date: Sat, 08 Feb 2020 15:23:21 +0100
> Cc: 1474 <at> debbugs.gnu.org, emacs <at> gentoo.org
>
> Stefan Kangas <stefan <at> marxist.se> 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.
This bug report was last modified 3 years and 57 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.