10

I feel like I'm missing something stupid obvious, but I've looked all over and can't find the answer to my question.

Suppose I have an application release that I've built with rebar and I start it a la

rel/my_app/bin/my_app start

I let it happily go about its business for a while, and then I want to attach a console to check on things, so I do

rel/my_app/bin/my_app attach

and get a shell. I muck around, and then when I'm done I want to quit the shell but leave the application running. If I do ^G q or q()., it brings down the entire application.

I've also played with starting the app with +Bi to stop it from allowing someone to accidentally close it, but then how does one even exit an attached shell at all?

dantswain
  • 5,427
  • 1
  • 29
  • 37

4 Answers4

14

I don't use rebar, I've never understood what problem it was meant to solve, but I assume when you "attach" you are doing the same thing as running to_erl. To exit in from this you type control-D (EOF).

Vance Shipley
  • 737
  • 4
  • 17
  • 2
    Commentary aside, you are correct :) Now that you point it out I feel like a dunce because it clearly says "(^D to exit)" lol. – dantswain Oct 17 '12 at 13:31
  • I use erl to start a new node (in Debian Linux 8, ssh terminal), but when I press Ctrl +D, nothing happens, why? – kingluo Jul 05 '15 at 05:52
4

CTRL-D should get you out and keep the app running.

Tilman
  • 2,015
  • 14
  • 16
0

Eshell V10.7 (abort with ^G)

$ Ctrl^G $ q

here,you can quit the remote console

  • 2
    I believe this will stop the application entirely, see the marked answer - Ctrl+D will detach and leave the application running. – Alastair Jan 26 '21 at 10:31
-5

If it's an ordinary remote shell, hitting Ctrl-C twice ought to do the trick.

Dan
  • 10,990
  • 7
  • 51
  • 80
  • 2
    On behalf of an anonymous user: This approach will stop the shell. If you're attached to a running application's shell, you may not want to exit this way as it will quit and stop that application. – artless noise Jun 17 '13 at 23:36