Evgeny Novikov wrote:
I assume that first of all the ldv-online client should be automatically restarted if it fails (say, we should check it every 5 minutes).
This was fixed by means of cron script (it checks even every 3 minutes of ldv-online presence):
ldvnode:/home/ldv # crontab -u ldv -l
...
*/3 * * * * /home/ldv/ldv-online-client-restart.pl >> /home/ldv/cron.log 2>&1
(
crontab -u ldv -e - to edit this cron script).
ldv/ldv-online-client-restart.pl is so (I put sources here to know about them):
#!/usr/bin/perl
# Check if there is an ldv online client instance running. Restart if no.
if (!`ps aux | grep vsClient.jar | grep -v grep`)
{
print("ldv-online client died, try to restart it!\n");
`/home/ldv/ldv-new/ldv-tools-inst/bin/ldv_client`
or die("Can't run ldv-online client");
print("ldv-online client is running now!\n");
}
else
{
print("ldv-online client works!\n");
}
After that cron log is so:
ldvnode:/home/ldv # cat /home/ldv/cron.log
ldv-online client works!
ldv-online client works!
ldv-online client works!
ldv-online client works!
ldv-online client works!
ldv-online client died, try to restart it!
ldv-online client is running now!
ldv-online client died, try to restart it!
ldv-online client is running now!
ldv-online client died, try to restart it!
ldv-online client is running now!
ldv-online client died, try to restart it!
ldv-online client is running now!
ldv-online client died, try to restart it!
ldv-online client is running now!
ldv-online client died, try to restart it!
ldv-online client is running now!
ldv-online client works!
ldv-online client works!
Also it shouldn't shut down in case when server becomes unavailable for some time.
One can see continuous "ldv-online client died, try to restart it!" messages above, in fact this was because of a bug in ldv-online client:
Exception in thread "main" java.lang.NullPointerException
at org.linuxtesting.ldv.online.vs.client.VClientProtocol.VSGetTask(VClientProtocol.java:64)
at org.linuxtesting.ldv.online.vs.client.VClient.main(VClient.java:31)
I has fixed it with help of Vadim in commit 435dc6e.