Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a peculiar problem. My server supports multiple ssh session simultaneously, so that multiple admins can manage it simultaneously.

We have a command which calls ztail to show the compressed log files and when the current ssh session is closed (without pressing ctrlc, to stop the tail command), the command should ideally stop working.

But what I observed when I start a new ssh session is that the process ztail is still running in the background and consuming CPU, even though the previous session was closed.

How can I determine when the session is closed, so that I can use that variable/flag to close/stop any commands initiated by that previously closed session?

share|improve this question

1 Answer 1

You don't say what is the command that you run in your ssh session and in turn invokes ztail, nor whether this command keeps running or not.

When you close the session, that command receives a SIGHUP signal, and should then dispose of ztail.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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