unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Stefan Kangas <stefan@marxist.se>
Cc: thierry.volpiatto@gmail.com, 1474@debbugs.gnu.org, emacs@gentoo.org
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	[thread overview]
Message-ID: <83v9ohcdi7.fsf@gnu.org> (raw)
In-Reply-To: <87eev56tuu.fsf@marxist.se> (message from Stefan Kangas on Sat, 08 Feb 2020 15:23:21 +0100)

> From: Stefan Kangas <stefan@marxist.se>
> Date: Sat, 08 Feb 2020 15:23:21 +0100
> Cc: 1474@debbugs.gnu.org, emacs@gentoo.org
> 
> Stefan Kangas <stefan@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.





  reply	other threads:[~2020-02-08 15:20 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-02 21:43 bug#1474: 23.0.60; desktop.el don't check if pid in his lock file is always in use Thierry Volpiatto
2008-12-02 22:39 ` Juanma Barranquero
2008-12-03  6:36   ` Thierry Volpiatto
2008-12-03  8:25     ` Juanma Barranquero
2008-12-03  8:47       ` Thierry Volpiatto
2008-12-03  9:15         ` Juanma Barranquero
2008-12-03 10:08           ` Thierry Volpiatto
2008-12-03 10:20             ` Juanma Barranquero
2008-12-03 21:27         ` Stefan Monnier
2008-12-03  9:14       ` Ulrich Mueller
2008-12-03  9:16         ` Juanma Barranquero
2008-12-02 22:52 ` Stefan Monnier
2008-12-02 23:06   ` Ulrich Mueller
2008-12-03  6:30   ` Thierry Volpiatto
2020-01-24 16:47 ` Stefan Kangas
2020-02-08 14:23   ` Stefan Kangas
2020-02-08 15:20     ` Eli Zaretskii [this message]
2020-04-27 10:34       ` Stefan Kangas
2020-04-27 14:50         ` Eli Zaretskii
2022-03-24  8:25           ` bug#1474: bug#25232: 24.4; Eliminate - Warning: Desktop file appears to be " Lars Ingebrigtsen

Reply instructions:

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

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

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

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

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

  git send-email \
    --in-reply-to=83v9ohcdi7.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=1474@debbugs.gnu.org \
    --cc=emacs@gentoo.org \
    --cc=stefan@marxist.se \
    --cc=thierry.volpiatto@gmail.com \
    /path/to/YOUR_REPLY

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

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

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

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