As someone new to threads, I got a lot of help from here (and the resident expert) and now have a working model. The original post is here:
Should I use threads? Perl/DHCP/Radius
To summarize: 3 threads exist. One thread reads log files for IP leases and parses MAC. The parsed MAC is used to spawn a new thread with checks a server and when the server sends a HTTP 200 OK, does a authentication calling the localhost and the thread detaches. The 3rd thread simply talks to the localhost to check which MACs are connected and holds/deletes them in a hash which all 3 threads share.
Some other issues related to 5.8.4 version were posted here: Perl5.8.4 , threads - Killing the "async" kid
I have since made two deployments and things are working satisfactorily. The daemon is part of the system start up sequence. All parts of the code seemed to have been proven.
There is however, one irritant though. The daemon dies sometimes forcing me to manually restart it. This has no pattern. Sometimes it dies in a few minutes, sometimes few hours and sometimes it runs until the system is restarted again (24hour cycle).
I tried the following:
appended at the end.>> lease.log 2>&1 &
None of them have written anything at all to the log file when the daemon dies unexpectedly . I repeat that there is no pattern here.
Any suggestions on how to get it to log something before it dies? Personally, I am looking at writing a wrapper around the daemon which checks its status one in a while. Has anyone done anything like this before? I am looking for advice in general. Please note: upgrade kernel, Perl not possible at all. I have looked into everything, strengthened the code with locks , ensured clean variable usage etc. Still the murderer (and the motives) are unknown, making me sleepless.
In reply to Coroner not helping - Perl5.8.4,threadsv1.03 and the case of myterious deaths by MonkeyMonk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |