~abcdw/rde-discuss

3 2

Wrong method invocation for 'sudo'

Demis Balbach <db@minikn.xyz>
Details
Message ID
<87ilvke5he.fsf@minikn.xyz>
DKIM signature
pass
Download raw message
Hello,

this is not a bug report, but something I encountered using Guix and
managed to fix, I thought maybe you want to apply the fix as well.

I wasn't able to open a file as root with tramp using `find-file` and
specifiying path:

--8<---------------cut here---------------start------------->8---
/sudo::/path/to/file
--8<---------------cut here---------------end--------------->8---

or

--8<---------------cut here---------------start------------->8---
/sudo::/root@localhost/path/to/file
--8<---------------cut here---------------end--------------->8---

It would error out saying: `Wrong method specification for 'sudo'`.
It took me a couple of hours to find this thread from 2016 (!!!)

https://lists.gnu.org/archive/html/help-guix/2016-10/msg00041.html

It seems like this issue still persists as of today. I fixed this by
using the provided code snippet in my emacs feature:


--8<---------------cut here---------------start------------->8---
(feature-emacs #:extra-init-el
                ;; https://lists.gnu.org/archive/html/help-guix/2016-10/msg00041.html
                `((require 'tramp)
                (setq tramp-remote-path
                        (append tramp-remote-path
                                '("~/.guix-home/bin"
                                "~/.guix-home/sbin"
                                "~/.guix-profile/bin"
                                "~/.guix-profile/sbin"
                                "/run/current-system/profile/bin"
                                "/run/current-system/profile/sbin")))))
--8<---------------cut here---------------end--------------->8---

After that, it worked. It baffled me that I found no other ressource
about that anywhere. But maybe this is interesing to for and you want to
apply the fix in RDE as well.

-- 
Best regards / Mit freundlichen Grüßen,
Demis Balbach
Details
Message ID
<878rwaw7gm.fsf@trop.in>
In-Reply-To
<87ilvke5he.fsf@minikn.xyz> (view parent)
DKIM signature
missing
Download raw message
On 2021-12-19 20:53, Demis Balbach wrote:

> Hello,
>
> this is not a bug report, but something I encountered using Guix and
> managed to fix, I thought maybe you want to apply the fix as well.
>
> I wasn't able to open a file as root with tramp using `find-file` and
> specifiying path:
>
> --8<---------------cut here---------------start------------->8---
> /sudo::/path/to/file
> --8<---------------cut here---------------end--------------->8---
>
> or
>
> --8<---------------cut here---------------start------------->8---
> /sudo::/root@localhost/path/to/file
> --8<---------------cut here---------------end--------------->8---
>
> It would error out saying: `Wrong method specification for 'sudo'`.
> It took me a couple of hours to find this thread from 2016 (!!!)
>
> https://lists.gnu.org/archive/html/help-guix/2016-10/msg00041.html
>
> It seems like this issue still persists as of today. I fixed this by
> using the provided code snippet in my emacs feature:
>
>
> --8<---------------cut here---------------start------------->8---
> (feature-emacs #:extra-init-el
>                 ;; https://lists.gnu.org/archive/html/help-guix/2016-10/msg00041.html
>                 `((require 'tramp)
>                 (setq tramp-remote-path
>                         (append tramp-remote-path
>                                 '("~/.guix-home/bin"
>                                 "~/.guix-home/sbin"
>                                 "~/.guix-profile/bin"
>                                 "~/.guix-profile/sbin"
>                                 "/run/current-system/profile/bin"
>                                 "/run/current-system/profile/sbin")))))
> --8<---------------cut here---------------end--------------->8---
>
> After that, it worked. It baffled me that I found no other ressource
> about that anywhere. But maybe this is interesing to for and you want to
> apply the fix in RDE as well.

Thank you, I implemented a slightly different version of your solution:

https://git.sr.ht/~abcdw/rde/tree/ba1eaf883f98ef994099da080c135735ba042157/rde/features/emacs.scm#L234
https://www.gnu.org/software/emacs/manual/html_node/tramp/Remote-programs.html

It's more universal and should work not only for guix, it tries to get
the $PATH value from /bin/sh -l (login shell).  The downside of such
approach is that you will need to recreate tramp connection in case of
changes of /etc/profile or ~/.profile or results of their evaluation.

For example, first invocation of guix install will create
~/.guix-profile/bin/profile, which is sourced by /etc/profile on Guix
System, thus the PATH defined in this script won't be propagated to the
current tramp session until it restarted.

I briefly tested it, but let me know if something doesn't work.

-- 
Best regards,
Andrew Tropin
Demis Balbach <db@minikn.xyz>
Details
Message ID
<87h7ayw4w9.fsf@minikn.xyz>
In-Reply-To
<878rwaw7gm.fsf@trop.in> (view parent)
DKIM signature
pass
Download raw message
Hello Andrew,

> I briefly tested it, but let me know if something doesn't work.

it works now. Thanks for implementing it!

-- 
Best regards / Mit freundlichen Grüßen,
Demis Balbach
Details
Message ID
<877dbt6ex1.fsf@trop.in>
In-Reply-To
<87h7ayw4w9.fsf@minikn.xyz> (view parent)
DKIM signature
missing
Download raw message
On 2021-12-24 13:42, Demis Balbach wrote:

> Hello Andrew,
>
>> I briefly tested it, but let me know if something doesn't work.
>
> it works now. Thanks for implementing it!

Sure ;)

-- 
Best regards,
Andrew Tropin
Reply to thread Export thread (mbox)