From: Jim Porter <jporterbugs@gmail.com>
To: the_wurfkreuz <the_wurfkreuz@proton.me>
Cc: 72013@debbugs.gnu.org
Subject: bug#72013: The eshell/kill command doesn't work with eshell/sudo correctly
Date: Tue, 9 Jul 2024 17:08:57 -0700 [thread overview]
Message-ID: <CANh=_JF09KdRMLhNaydr_yArrYsKDD2buTfYKfkqEr+-21egxQ@mail.gmail.com> (raw)
In-Reply-To: <FzIMSNqLEmByDFP6l93Tg2cAkopa20KM4W1sArsq0kPAfLqDZg5egeKf4wLaqxkGI5DCexUsNta70roOjORbqHIB4w4zZeB_kUgaN8her48=@proton.me>
(Re-adding the bug tracker address. The tracker requires using Reply
All to keep messages going to the list.)
On Tue, Jul 9, 2024 at 11:38 AM the_wurfkreuz <the_wurfkreuz@proton.me> wrote:
> Sorry, i was exhausted when i was rechecking everything before submitting the bug report and made a slip up. In reality the problem is with processes owned by root. I was trying to send signal to a docker daemon.
Ah ha. This is really an issue that 'eshell/kill' can't kill "remote"
processes. What you *want* to happen is for Eshell to kill the process
with some PID over the Tramp "sudo" connection, which makes it a
"remote" process. That'll fail for a couple reasons: 1) Eshell just
passes the PID to 'signal-process', and that PID will be interpreted
according to your local host+user, 2) Tramp doesn't support
'signal-process' in the first place, as far as I know (but it does
support things like 'delete-process').
> Also, it looks like it doesn't work even when i write 'eshell/kill' instead of 'kill'. The main point is that i can use the 'kill' command only with posix sudo when it comes to processes owned by root. Using it with eshell/sudo doesn't work:
/usr/bin/sudo works here because it doesn't call eshell/kill, it calls
/usr/bin/kill. eshell/sudo would also work if you call /usr/bin/kill.
You could spell the full path like that, or use "*kill", which ignores
the Eshell built-in version.
Your scenario is actually the *less* dangerous one though: since a
Tramp sudo connection is still (usually) on localhost, the PIDs are
all the same; all that'll happen is that "kill" fails sometimes. But
if you were connected over SSH to a remote host and ran "kill" in
Eshell, it would be killing *local* processes. That's highly
unexpected and would probably cause serious problems! I think the best
way to fix this would simply be for 'eshell/kill' to fall back to
'/usr/bin/kill' any time the default-directory is remote. That way is
a lot safer.
next prev parent reply other threads:[~2024-07-10 0:08 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-09 13:04 bug#72013: The eshell/kill command doesn't work with eshell/sudo correctly the_wurfkreuz via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-07-09 17:02 ` Jim Porter
[not found] ` <FzIMSNqLEmByDFP6l93Tg2cAkopa20KM4W1sArsq0kPAfLqDZg5egeKf4wLaqxkGI5DCexUsNta70roOjORbqHIB4w4zZeB_kUgaN8her48=@proton.me>
2024-07-10 0:08 ` Jim Porter [this message]
2024-07-10 0:22 ` Jim Porter
2024-07-18 19:33 ` Jim Porter
2024-07-10 7:33 ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-07-14 22:14 ` Jim Porter
2024-07-14 22:17 ` Jim Porter
2024-07-15 7:10 ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-07-15 11:00 ` Eli Zaretskii
2024-07-15 16:36 ` Jim Porter
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CANh=_JF09KdRMLhNaydr_yArrYsKDD2buTfYKfkqEr+-21egxQ@mail.gmail.com' \
--to=jporterbugs@gmail.com \
--cc=72013@debbugs.gnu.org \
--cc=the_wurfkreuz@proton.me \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.