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
View this message in rfc822 format
Eli Zaretskii <eliz <at> gnu.org> 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
This bug report was last modified 3 years and 58 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.