I have a peculiar problem. My server supports multiple ssh session simultaneously, so that multiple admins can manage (via command line interface) it simultaneously. We have a command which calls ztail to show the compressed log files. Now when the current ssh session is closed (without pressing Ctrl-C, to stop the ztail command), this command should ideally stop working. But what I observed when I start a new ssh session that, the process (ztail) is still running in background and consuming my CPU, even though the previous session was closed. Now how can I know when the session was closed, so that I can use that variable/flag to close/stop any commands initiated by that previously closed session?
How to stop a infinite running process (ztail) started by a ssh session after that session is closed
|
|
||||
|
|
This only happens if you run Usually when you start a standard So the easiest thing for you would be to utilize this default behavior. Have a look at |
|||||
|
|
During the ssh-session a shell-session will be a child process. That child process will have another child process: To if the parent-pid of |
|||
|
|