Commits

Anonymous committed 145672b

Commit change by mbrittain

  • Participants
  • Parent commits 78500bf

Comments (0)

Files changed (1)

File src/ganglia-logtailer

 #gmetric = '/bin/echo'
 logtail = '/usr/sbin/logtail'
 logtail_statedir = '/var/lib/ganglia-logtailer/'
-
+script_start_time = time.time()
 
 ## set up logging infrastructure for use throughout the script
 logDir = '/var/log/ganglia'
             logger.warning('duration (%s) less than 45s, despite being called from cron.  Shouldn\'t happen. (line: %s)' % (duration, lineno()))
         #print 'metric measure with duration: %s' % duration
         submit_stats(parser, metric_prefix, gmetric_options, duration=duration)
+        # Reset mtime/atime on state file so duration isn't thrown off by long execution times.
+        os.utime(logtail_state_file, (floor(script_start_time), floor(script_start_time)))
         end_locking(lockfile, logtail_lock_file)
 
     # try and remove the lockfile one last time, but it's a valid state that it's already been removed.