--- loncom/loncron 2010/08/17 22:22:00 1.86 +++ loncom/loncron 2011/05/14 16:12:53 1.89 @@ -2,7 +2,7 @@ # Housekeeping program, started by cron, loncontrol and loncron.pl # -# $Id: loncron,v 1.86 2010/08/17 22:22:00 raeburn Exp $ +# $Id: loncron,v 1.89 2011/05/14 16:12:53 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -32,6 +32,7 @@ use strict; use lib '/home/httpd/lib/perl/'; use LONCAPA::Configuration; +use LONCAPA; use Apache::lonnet; use Apache::loncommon; @@ -821,9 +822,12 @@ sub main () { print $fh "$key\n"; } close($fh); - my $execpath = $perlvar{'lonDaemons'}.'/lciptables'; - system("$execpath $tmpfile"); - unlink($fh); + if (&LONCAPA::try_to_lock('/tmp/lock_lciptables')) { + my $execpath = $perlvar{'lonDaemons'}.'/lciptables'; + system("$execpath $tmpfile"); + unlink('/tmp/lock_lciptables'); # Remove the lock file. + } + unlink($tmpfile); } } @@ -866,12 +870,10 @@ sub main () { &check_delayed_msg($fh); &finish_logging($fh); &log_simplestatus(); - - if ($totalcount>200 && !$noemail) { &send_mail(); } - } - if (!$justcheckconnections && !$justreload) { &write_loncaparevs(); &write_serverhomeIDs(); + + if ($totalcount>200 && !$noemail) { &send_mail(); } } }