cleanup temporary files
When running rad_eap_test from icinga and reloading the icinga process, some of the running tests still get killed and don't delete temporary files.
In icinga2 log there is:
[2018-08-03 13:00:58 +0200] warning/PluginCheckTask: Check command for object 'radius1.cuni.cz!PING' (PID: 24108, arguments: '/usr/lib/nagios/plugins/check_ping' '-4' '-H' 'radius1.cuni.cz' '-c' '200,15%' '-w' '100,5%') terminated with exit code 128, output: <Terminated by signal 15 (Terminated).>
Any thoughts on how can i simulate this to determine where exactly the problem is? From the part of the log above, it seems that the ping command itself terminates. Could this be the same with rad_eap_test?
I've looked into this and tried two main possibilities:
- the eapol_test gets terminated and rad_eap_test continues to run
Can be simulated by running some check in icingaweb2 and concurrently running
line=$(ps aux | grep eapol_test | grep tested-realm.cz); pid=$( echo $line | awk '{ print $2 }'); kill -INT $pid; echo $line
Tried this with signals INT, TERM, KILL.
In all cases rad_eap_test returns information about probable configuration error and does not intentionally delete temporary files.
- the rad_eap_test gets terminated and eapol_test continues to run:
Can be simulated by running some check in icingaweb2 and concurrently running
line=$(ps aux | grep rad_eap | grep tested-realm.cz); pid=$( echo $line | awk '{ print $2 }'); kill -INT $pid; echo $line
Tried this with signals INT, TERM, KILL.
When sending INT or TERM, the check status in icingaweb changes to CRITICAL with no output. All the temporary files are removed.
When sending KILL, the status in icingaweb is UNKNOWN and plugin output is <Terminated by signal 9 (Killed).>. The temporary files still exist.
In icinga2 log there is:
[2018-08-16 11:11:49 +0200] warning/Process: PID 20285 was terminated by signal 9 (Killed)
[2018-08-16 11:11:49 +0200] warning/PluginCheckTask: Check command for object '[email protected]' (PID: 20285, arguments: '/usr/lib/nagios/plugins/rad_eap_test' '-H' 'x' '-M' 'x' '-P' '1812' '-S' 'x' '-e' 'PEAP' '-i' 'x' '-m' 'WPA-EAP' '-p' 'x' '-t' '50' '-u' 'x') terminated with exit code 128, output: <Terminated by signal 9 (Killed).>
This seems to be the problematic case.