screen-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Killing backticks when bouncing screen.


From: Chris Jones
Subject: Killing backticks when bouncing screen.
Date: Mon, 19 Jan 2009 21:20:55 -0500
User-agent: Mutt/1.5.13 (2006-08-11)

I have written a few scripts that display monitoring counters on the
hardstatus line.

Thinking I would avoid the overhead of starting new processes,
particularly for stuff that requires frequent updates in order to be
relevant ..  such as CPU utilization, I thought I'd write scripts that
run in the background & iterate for ever over the following: acquire
data, format & write to stdout, sleep a while, etc.

The corresponding backtick commands in my .screenrc specify values of
zero for "lifespan" & "autorefresh" - as documented on the screen man
page:

"If both the lifespan and the autorefresh parameters are zero, the
backtick program is expected to stay in the background and generate
output once in a while.  In this case, the command is executed right
away and screen stores the last line of output.  If  a new line gets
printed screen will automatically refresh the hardstatus or the
captions."

The problem is that, if for some reason or other, I terminate the
GNU/sreen instance, the orphaned processes still run under the init
process.

As I was testing the layout of my hardstatus line the other day, I
eventually noticed--thanks to my monitoring, and the laptop's fan
kicking in :-) .. that I was using dollops of ram & cpu cycles .. well,
it turned out some 20-30 instances of my scripts and the related sleep
subprocesses were still running in the background.

Whenever I shut down a screen instance (manually terminating each
individual application), I would need to terminate those scripts as
well.. at the same time GNU/screen issues the "screen terminating"
message.

The problem is how?

Has anyone gone down this road before and found a clean solution?

Thanks,

CJ




reply via email to

[Prev in Thread] Current Thread [Next in Thread]