Oops, guess I should have looked for statistics.
John, Risto, thanks for the very thorough help and the best in 2015.
-Michael
From: Risto Vaarandi [mailto:[email protected]]
Sent: Wednesday, December 31, 2014 5:17 PM
To: [email protected]
Cc: Michael Hare; [email protected]
Subject: Re: [Simple-evcorr-users] finding dead/unused rules in a config file
2015-01-01 0:28 GMT+02:00 John P. Rouillard
<[email protected]<mailto:[email protected]>>:
>I searched the mailing list for 'dead' and 'unused' and came up
>empty. Admittedly I have perused the intimidatingly long manpage but
>haven't read it front to back.
Usually people just grab the data at runtime using:
kill -USR1 <sec pid>
You may want to create a calendar rule with an action that calls
shellcmd to remove the dump file and send a kill -USR1 to the sec
process to keep a more or less up to date dump file (but having it
automatically updated may interfere with using it to debug sec).
I was going to suggest using --intevents and a rule that matches
SEC_SHUTDOWN to send a kill -USR1 to the SEC process, but I am not
sure what happens to signal handling when SEC is planning to exit.
Risto may be able to tell you what will happen in this case.
That's an interesting question. In fact, when SEC is sent the TERM signal, a
flag is raised which is handled in a separate routine (the very same routine
takes care of the USR1 signal). The relevant piece of code in this routine
looks like this:
if ($terminate) {
log_msg(LOG_NOTICE, "SIGTERM received: shutting down SEC");
if ($intevents) {
$terminate = 0;
internal_event("SEC_SHUTDOWN");
if ($childterm) { sleep(TERMTIMEOUT); }
}
if ($childterm) { child_cleanup(); }
exit(0);
}
As you can see, if the $terminate flag is set, the SEC process will exit
without leaving this code block, so there is no opportunity to process USR1
signal at this point. However, few months back an interesting recipe was posted
to the mailing list which was related to the windows platform where many UNIX
signals do not exist. This solution can be easily used for addressing the
current problem:
http://sourceforge.net/p/simple-evcorr/mailman/message/32744248/
To adjust the solution for your problem, you might rewrite it like this:
type=single
ptype=substr
pattern=SEC_SHUTDOWN
context=SEC_INTERNAL_EVENT
desc=produce the dumpfile
action=lcall %o -> ( sub { main::dump_data(); } )
This rule matches the SEC_SHUTDOWN event and calls the dump_data() routine in
SEC code. This routine is used for producing the dump file when USR1 signal is
handled. Since dump_data() does not overwrite an existing dump file, make sure
it is not present at SEC shutdown or remove it with unlink() before calling
dump_data(), for example lcall %o -> ( sub { unlink($main::dumpfile);
main::dump_data(); } )
Also, since it's already January 1 here, I wish you and all list members a
Happy New Year :)
kind regards,
risto
------------------------------------------------------------------------------
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
_______________________________________________
Simple-evcorr-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/simple-evcorr-users