1

I think I've found a bug with emacs+org+babel. This block runs fine

#+BEGIN_SRC sh :dir /ssh:ubuntu@54.175.231.31:~/ :exports both :results output                                
sudo service --status-all                                                                                  
#+END_SRC  

This block freezes emacs

#+BEGIN_SRC sh :dir /ssh:ubuntu@54.175.231.31:~/ :exports both :results output                                
sudo service apache2 status                                                                                   
#+END_SRC 

enter image description here

This is the expected output

ubuntu@ip-172-31-4-188:~$ sudo service apache2 status
● apache2.service
   Loaded: not-found (Reason: No such file or directory)
   Active: inactive (dead)
ubuntu@ip-172-31-4-188:~$ 

1 Answer 1

1

Likely, there is a problem in handling the password of the sudo command. Try

#+BEGIN_SRC sh :dir /ssh:ubuntu@54.175.231.31|sudo:54.175.231.31:~/ :exports both :results output
service apache2 status
#+END_SRC

The sudo password is handled by Tramp then. This works for me, at least.

5
  • but, "sudo service --status-all" works.... Feb 17, 2018 at 20:02
  • on an Amazon EC2 ubuntu vm, the ubuntu user is a privileged "sodoer" , so no prompts to sudo. Feb 17, 2018 at 20:03
  • Have you tried whether the recipe works? This is what counts. Feb 18, 2018 at 9:06
  • No luck. same deal. Last thing printed in echo area is "Wrote /ssh:ubuntu@54.90.109.247|sudo:root@54.90.109.247:/tmp/ob-input-OlELLu" before emacs freezes Feb 18, 2018 at 21:45
  • You could try to trace Tramp, by setting tramp-verbose to 10. But I fear it won't help, because the freezing is in the command out of Tramp control. Feb 19, 2018 at 6:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.