Sophie

Sophie

distrib > Arklinux > devel > x86_64 > by-pkgid > 276525c05976da78645add6c004c28dd > files > 7

ctcs-1.3.0pre8-1ark.src.rpm

diff -urN ctcs-1.3.0pre8.bckk/run ctcs-1.3.0pre8/run
--- ctcs-1.3.0pre8.bckk/run	2002-10-23 01:39:17.000000000 +0100
+++ ctcs-1.3.0pre8/run	2003-01-19 01:12:19.000000000 +0000
@@ -20,6 +20,7 @@
 use lib 'lib/perl';
 use POSIX;
 use POSIX qw(:signal_h :errno_h :sys_wait_h);
+use Sys::Syslog;
 
 # this is my hacked up color library.  Eventually run should use
 # curses directly.
@@ -412,6 +413,8 @@
 	my $current_next_check=$current_check_every;
 	my $autoexit_check_every=20;
 	my $autoexit_next_check=$autoexit_check_every;
+	my $next_pulse_time = 0;
+	my $pulse_interval = 6; # 1 unit of time = 10 secs.  Why, I don't know.
 	
 	if (defined(POSIX::nice(-10))) {
 		++$nice;
@@ -437,6 +440,13 @@
 		# this should reduce overhead in the checking area by close to 95%
 		if ($current_time >= $current_next_check) {
 			$current_next_check = $current_time + $current_check_every;
+
+			# Calculate whether heartbeat msg should be printed
+			if ($current_time >= $next_pulse_time) {
+			    $next_pulse_time = $current_time + $pulse_interval;
+			    syslog ("info", "Heartbeat: " . sectotime($current_time));
+			}
+
 			if (!$notified
 			  && defined($environment{"notify_message"})
 			  && $current_time >= $environment{"notify"}) {
@@ -927,7 +937,13 @@
 #
 
 if($#ARGV == -1) {
+	openlog ("Cerberus", "", "local7");
+#	setlogmask ("debug");
 	main(("-"));
+	closelog();
 } else {
+	openlog("Cerberus", "", "local7");
+#	setlogmask ("debug");
 	main(@ARGV);
+	closelog();
 }