开发者

Log out of an SSH session into Erlang VM without stopping the VM or leaving stale processes

开发者 https://www.devze.com 2022-12-25 13:57 出处:网络
I have an Erlang application running as a daemon, configured as an SSH server.I can connect to it with an SSH client and I get the standard Erlang REPL.

I have an Erlang application running as a daemon, configured as an SSH server. I can connect to it with an SSH client and I get the standard Erlang REPL.

If I 'q().' I shut down the Erlang VM, not the connection. If I close the connection ('~.' for OpenSSH, close the window in PuTTY) some processes remain under the sshd_sup/ssh_system_xx_sup tree. These开发者_JAVA百科 appear to be stale shell processes.

I do not see any exported function in the shell module that would let me shut down the shell (and therefore the SSH connection) without affecting the entire VM.

How should I be logging out of the SSH session to not leave stale processes in the VM?


'exit().' in the SSH client shuts down the connection without stopping the VM.

I could not find this documented anywhere, but it seems to do almost what I want.

Instead of leaving 4 stale processes per terminated connection like killing the client, 'exit().' leaves 2 stale processes.

This may now be in the realm of the 'ssh' module and no longer in the realm of the 'shell' module.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号