#!/bin/tcsh # Listen to alert data from ../../source/generate_alerts/realtime_alerts. # Merge the data from multiple producers. Add a sequential id number to each # record. Forward the data to listeners. # Alert and top list data is virtually identical in structure. The master # keeps these two streams of data separate from each other, but otherwise # treats them identically. Inside the master code the only difference between # top list master and the alerts master is a string that tells is which config # items to read and how to mark things in the log file. # We separated the alerts and top lists only to spread the load between more # processors. For a long time these ran on the same process. # To restart the server type # kill `pidof fast_alert_search_master_alerts` || echo no process found # This is like killall, but without the bug found in Fedora 31 & 32. # Note that you get an error message if nothing is killed. If you see # "no process found", this loop is probably not running and you didn't # really restart the server. cd $0:h if ($1 == inner) then # At this point we are typically not expecting to see a previous process. # If we see one we kill it, just to be safe. But in that case we warn # the user because it is unexpected. In particular, if two copies of the # loop are running at once, that is a pain to fix, and you want to catch # it quickly. kill `pidof fast_alert_search_master_alerts` && echo WARNING: Killed previous. limit coredumpsize unlimited limit descriptors unlimited limit set printexitvalue=1 while 1 date ./fast_alert_search_master_alerts -f ../config_common.txt -f config_master_alerts.txt sleep 1 end else ./$0:t inner < /dev/null >>& output_master_alerts.txt & endif