All,
This is not very pretty at all, but if you are on a vt100 compatible
terminal, you might like this.
I wanted to sticky my amavisd-nanny in a small window and leave it on my
desktop.
But, it continually scrolls. Some might like seeing that historical
data, but I wanted real time redraws.
So, here is a quick patch for nanny. It will clear the screen, home the
cursor, and run.
After each output it homes the cursor for updates.
(the terminal windows must be 4+<x> rows tall for proper output. Where
<x> is amavisd processes)
Thanks,
Jason
--- /usr/src/amavisd-new-2.5.2/amavisd-nanny 2007-03-29
06:26:48.000000000 -0400
+++ amavisd-nanny 2007-09-13 09:49:04.000000000 -0400
@@ -110,10 +110,15 @@
die "Usage: $0 [ -w <wait-interval> ]\n";
}
}
+ for (my $i=0; $i<100; $i++) {
+ print ' ' x 75, "\n";
+ }
+ printf "\033[H";
print <<'EOD';
process-id task-id elapsed in elapsed-bar (dots indicate idle)
or state idle or busy
EOD
+
my($env) = BerkeleyDB::Env->new(
'-Home'=>$db_home, '-Flags'=> DB_INIT_CDB | DB_INIT_MPOOL);
defined $env or die "BDB no env: $BerkeleyDB::Error $!";
@@ -251,6 +256,11 @@
}
$| = 1;
Time::HiRes::sleep($wakeuptime);
+ printf "\033[3;0H";
+
} # forever
END {
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
AMaViS-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/amavis-user
AMaViS-FAQ:http://www.amavis.org/amavis-faq.php3
AMaViS-HowTos:http://www.amavis.org/howto/