Erlang detach shell from node / Quit shell without killing node
Asked Answered
P

4

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?

Puffery answered 17/10, 2012 at 2:38 Comment(0)
S
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).

Scrophulariaceous answered 17/10, 2012 at 4:19 Comment(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.Puffery
I use erl to start a new node (in Debian Linux 8, ssh terminal), but when I press Ctrl +D, nothing happens, why?Visually
U
4

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

Unmake answered 17/10, 2012 at 5:9 Comment(0)
W
0

Eshell V10.7 (abort with ^G)

$ Ctrl^G $ q

here,you can quit the remote console

Wacky answered 26/1, 2021 at 8:54 Comment(1)
I believe this will stop the application entirely, see the marked answer - Ctrl+D will detach and leave the application running.Rachmaninoff
S
-5

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

Sommer answered 17/10, 2012 at 4:30 Comment(1)
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.Fluorescein

© 2022 - 2024 — McMap. All rights reserved.