Tagged Questions

The tag has no wiki summary.

learn more… | top users | synonyms

3
votes
2answers
3k views

From shell, killing a process if wallclock runtime exceeds some predetermined value

I want to start a process from a shell script, allow it to interact with the user (so I cannot just background it, grab the PID, launch sleep followed by sanity checks and kill), but if it is still ...
3
votes
1answer
2k views

How to kill a command started over SSH - the SSH connection lost

If I use timeout 10 ssh -n -o BatchMode=yes 1.1.1.1 'sleep 20' > 1.1.1.1.txt 2>&1 & To give out a remote command on a server, and I kill the SSH connection after 10 seconds, then I ...
3
votes
3answers
337 views

Kill process when it stops to produce further output

Is there a shell tool which can probe if a subprocess is still producing output, and otherwise kill it after a specified timeout? I'm using offlineimap for Gmail backup, but that's very very very ...
6
votes
1answer
3k views

How long is a TCP local socket address that has been bound unavailable after closing?

On Linux (my live servers are on RHEL 5.5 - the LXR links below are to the kernel version in that), man 7 ip says: A TCP local socket address that has been bound is unavailable for some time after ...
32
votes
5answers
6k views

Timing out in a shell script

I have a shell script that's reading from standard input. In rare circumstances, there will be no one ready to provide input, and the script must time out. In case of timeout, the script must execute ...