Re: how to have gawk receive user signals?
- From: arnold@xxxxxxxxxx (Aharon Robbins)
- Date: Sun, 20 Dec 2009 02:32:41 +0000 (UTC)
There is no way to do this (without hacking on the source code).
You can have a shell script respond to signals, so it may be easiest
to wrap your awk script in a shell program to manage the signal
handling.
Thanks,
Arnold
Hmmmm... This might be doable as a loadable module. There are memory
management issues to deal with, though.
In article <18hii5l1chtuvjv0n4htdb39famm3nu6g9@xxxxxxx>,
Grant <g_r_a_n_t_@xxxxxxxxxxxxxxxxx> wrote:
Hi there,--
Is there a way to have gawk respond to a user signal? I'd like
to tell a gawk script to restart after logrotate does its thing
and pulls a logfile out from under a log pretty-printer script.
The gawk script is evoked by:
# tail -f /var/log/messages | sf4sf -f /etc/sf4sf.conf
And, in the main loop, there's:
...
########################### start main program ##############################
!initialised { initialise(); ++initialised }
# read database files
...
So all I need to restart script is set 'initialised' to zero in
response to a user signal, perhaps -HUP?
My reading of the gawk info doesn't tell much about what signal
handling is available to the running script.
I'm using gawk-3.1.7 on Slackware-11.
[0] http://bugsplatter.id.au/firewall/sf4sf.txt for the curious ;)
Grant.
--
http://bugsplatter.id.au
Aharon (Arnold) Robbins arnold AT skeeve DOT com
P.O. Box 354 Home Phone: +972 8 979-0381
Nof Ayalon Cell Phone: +972 50 729-7545
D.N. Shimshon 99785 ISRAEL
.
- References:
- how to have gawk receive user signals?
- From: Grant
- how to have gawk receive user signals?
- Prev by Date: Re: gawk/Windows/cmd.exe/ARGV
- Next by Date: Re: Detecting X from AWK
- Previous by thread: how to have gawk receive user signals?
- Next by thread: Detecting X from AWK
- Index(es):
Relevant Pages
|