head	1.12;
access;
symbols
	TIGRIS_1_1_0RC2:1.5.6.2
	TIGRIS_1_1_0RC1:1.5.6.2
	TIGRIS_1_1:1.5.6.2.0.2
	TIGRIS_1_0_8:1.5.6.1
	TIGRIS_1_0_8RC3:1.5.6.1
	TIGRIS_1_0_8RC2:1.5.6.1
	TIGRIS_1_0_8RC1:1.5.6.1
	TIGRIS_1_0_7:1.5.6.1
	TIGRIS_1_0_7RC3:1.5.6.1
	TIGRIS_1_0_7RC2:1.5.6.1
	TIGRIS_1_0_7RC1:1.5
	TIGRIS_1_0_6:1.5
	TIGRIS_1_0_6RC5:1.5
	TIGRIS_1_0_6RC4:1.5
	TIGRIS_1_0_6RC3:1.5
	TIGRIS_1_0_6RC2:1.5
	TIGRIS_1_0_6RC1:1.5
	TIGRIS_1_0_5:1.5
	TIGRIS_1_0_5RC6:1.5
	TIGRIS_1_0_5RC5:1.5
	TIGRIS_1_0_5RC4:1.5
	TIGRIS_1_0_5RC3:1.5
	TIGRIS_1_0_5RC2:1.5
	TIGRIS_1_0_5RC1:1.5
	TIGRIS_1_0_4:1.5
	TIGRIS_1_0_3:1.5
	TIGRIS_1_0_2:1.5
	TIGRIS_1_0_1:1.5
	TIGRIS_1_0:1.5.0.6
	TIGRIS_1_0_0:1.5
	TIGRIS_1_0_0_RC1:1.5.0.2;
locks; strict;
comment	@# @;


1.12
date	2001.07.25.19.42.55;	author edk;	state Exp;
branches;
next	1.11;

1.11
date	2001.07.02.20.23.06;	author ms;	state Exp;
branches;
next	1.10;

1.10
date	2001.06.29.22.07.51;	author ms;	state Exp;
branches;
next	1.9;

1.9
date	2001.06.29.21.59.12;	author ms;	state Exp;
branches;
next	1.8;

1.8
date	2001.06.26.20.05.14;	author ms;	state Exp;
branches;
next	1.7;

1.7
date	2001.06.04.22.22.55;	author ms;	state Exp;
branches;
next	1.6;

1.6
date	2001.05.21.19.17.19;	author ms;	state Exp;
branches;
next	1.5;

1.5
date	2001.03.24.01.32.20;	author stack;	state Exp;
branches
	1.5.6.1;
next	1.4;

1.4
date	2001.03.03.00.18.01;	author ms;	state Exp;
branches;
next	1.3;

1.3
date	2001.03.02.02.48.44;	author ms;	state Exp;
branches;
next	1.2;

1.2
date	2001.02.22.00.41.35;	author ms;	state Exp;
branches;
next	1.1;

1.1
date	2001.02.07.21.30.14;	author ms;	state Exp;
branches;
next	;

1.5.6.1
date	2001.07.02.20.15.51;	author ms;	state Exp;
branches;
next	1.5.6.2;

1.5.6.2
date	2001.07.25.19.41.57;	author edk;	state Exp;
branches;
next	;


desc
@@


1.12
log
@$lck wasn't defined but it was being used in one location.  define it
and use it consistently.  minor reformatting for 80 columns.
@
text
@#!/usr/bin/perl

use strict;

close STDOUT;
close STDERR;
open STDERR, ">>__SANDBOX__/log/debug/eyebrowse.log";
open STDOUT, ">>__SANDBOX__/log/debug/eyebrowse.log";

# setup lockfile and exit if it exists - another eb is running
my $lck_dir = "__SANDBOX__/log";
my $lck_file = "eyebrowse.lck";
my $lck = "$lck_dir/$lck_file";
$| = 1;

if (-e $lck) {
    die "Lockfile $lck exists already, exiting\n";
} else {
    if (! -d $lck_dir) { 
        mkdir($lck_dir, 0766) or die "Can't make $lck_dir : $!\n";
    }
    open SIMPLE_LOCK, ">$lck" 
        or die "Can't touch $lck, error: $!\n";
    close SIMPLE_LOCK;
}

$ENV{JAVA_HOME} = '/usr/jdk';
$ENV{PATH} = "$ENV{PATH}:/opt/IBMJava2-13/bin";
$ENV{SANDBOX} = '__SANDBOX__';
$ENV{CLASSPATH} = '/usr/lib/java/collections.jar:/usr/lib/java/mysql.jar:/usr/lib/java/mail.jar:/usr/lib/java/gnu-regexp.jar:/usr/lib/java/activation.jar:/usr/lib/java/log4j.jar:/usr/lib/java/lucene.jar';

my @@command = ('__SANDBOX__/site/scripts/eyebrowse/eyebrowse',
                '--command=update',
                '--props=__SANDBOX__/conf/eyebrowse/eyebrowse.properties');

if ($> == 0) {
    unshift @@command, 'setuidgid', 'tigrisq';
}

if ( ! -d "__SANDBOX__/log/debug" ){
    mkdir("__SANDBOX__/log/debug", 0755) or die "Can't setup log dir , $!";
}

#timestamp
print scalar(localtime) . "\n";

unless (system(@@command) == 0) {
    print "@@command FAILED : $?\n";
}

unlink "$lck" or die "Can't unlink $lck : $!\n";
@


1.11
log
@remove the lock file
@
text
@d3 2
d13 2
d19 1
a19 1
    if (! -e $lck_dir) { 
d22 2
a23 2
    open SIMPLE_LOCK, ">$lck_dir/$lck_file" 
        or die "Can't touch $lck_dir/$lck_file, error: $!\n";
d32 2
a33 1
my @@command = ('__SANDBOX__/site/scripts/eyebrowse/eyebrowse','--command=update',
d51 1
a51 1
unlink "$lck_dir/$lck_file" or die "Can't unlink $lck_dir/$lck_file : $!\n";
@


1.10
log
@changed lock dir to SANDBOX/log/
@
text
@d45 2
@


1.9
log
@fixed file opening and error handling, thanks ed for pointing out my doioioiioioi
@
text
@d9 1
a9 1
my $lck_dir = "__SANDBOX__/data/eyebrowse/lock";
a10 1
my $touch = '/bin/touch';
@


1.8
log
@setup cron lock file. dont run multiple eb updates
@
text
@d19 3
a21 1
    system($touch, "$lck_dir/$lck_file") or die "Can't $touch $lck: $?\n";
@


1.7
log
@passing location of property file to script
@
text
@d3 19
a32 2
close STDOUT;
close STDERR;
a37 3
open STDERR, ">>__SANDBOX__/log/debug/eyebrowse.log";
open STDOUT, ">>__SANDBOX__/log/debug/eyebrowse.log";

d41 3
a43 1
system(@@command);
@


1.6
log
@add timestamp to file
@
text
@d8 2
a9 1
my @@command = ('__SANDBOX__/site/scripts/eyebrowse/eyebrowse','--command=update');
@


1.5
log
@Made the following changes:

-- Made an access, error, and debug subdir in $SANDBOX/log dir.
-- Made apache log hits in access_log in the $SANDBOX/log/access subdir.
-- Made apache log errors to error_log in $SANDBOX/log/error subdir.
-- All other logs, those w/o a distinct 'access' or 'error' character, now
go into the $SANDBOX/log/debug subdir (WebMacro.log, Turbine.log, etc.).

Reason for this relocation of logs (From Brian):

Ops needs an extremely reliable way to roll logs off of the production
servers, even before a site is in production; being able to write scripts
that assume that "all logs in *access* need to be kept forever", and "all
logs in *debug* and *error* are temporary and cullable within some set
amount of time" is mandatory.  This way we don't have to adjust the
rollover script every time apps-dev wants to have another app start
logging - just log it into the right place and we'll roll it away.

IZ2313

PR:
Obtained from:
Submitted by:
Reviewed by:
@
text
@d23 3
@


1.5.6.1
log
@put single eyebrowse lock in branch to keep multiple crons from running
@
text
@a2 20
close STDOUT;
close STDERR;
open STDERR, ">>__SANDBOX__/log/debug/eyebrowse.log";
open STDOUT, ">>__SANDBOX__/log/debug/eyebrowse.log";

# setup lockfile and exit if it exists - another eb is running
my $lck_dir = "__SANDBOX__/log";
my $lck_file = "eyebrowse.lck";

if (-e $lck) {
    die "Lockfile $lck exists already, exiting\n";
} else {
    if (! -e $lck_dir) { 
        mkdir($lck_dir, 0766) or die "Can't make $lck_dir : $!\n";
    }
    open SIMPLE_LOCK, ">$lck_dir/$lck_file" 
        or die "Can't touch $lck_dir/$lck_file, error: $!\n";
    close SIMPLE_LOCK;
}

d8 1
a8 2
my @@command = ('__SANDBOX__/site/scripts/eyebrowse/eyebrowse','--command=update',
                '--props=__SANDBOX__/conf/eyebrowse/eyebrowse.properties');
d13 2
d20 2
a21 6
#timestamp
print scalar(localtime) . "\n";

unless (system(@@command) == 0) {
    print "@@command FAILED : $?\n";
}
d23 1
a23 1
unlink "$lck_dir/$lck_file" or die "Can't unlink $lck_dir/$lck_file : $!\n";
@


1.5.6.2
log
@$lck wasn't defined but it was being used in one location.  define it
and use it consistently.  minor reformatting for 80 columns.
@
text
@a2 2
use strict;

a10 2
my $lck = "$lck_dir/$lck_file";
$| = 1;
d15 1
a15 1
    if (! -d $lck_dir) { 
d18 2
a19 2
    open SIMPLE_LOCK, ">$lck" 
        or die "Can't touch $lck, error: $!\n";
d28 1
a28 2
my @@command = ('__SANDBOX__/site/scripts/eyebrowse/eyebrowse',
                '--command=update',
d46 1
a46 1
unlink "$lck" or die "Can't unlink $lck : $!\n";
@


1.4
log
@classpath change, lucene
@
text
@d16 2
a17 2
if ( ! -d "__SANDBOX__/log/services" ){
    mkdir("__SANDBOX__/log/services", 0755) or die "Can't setup log dir , $!";
d20 2
a21 2
open STDERR, ">>__SANDBOX__/log/services/eyebrowse.log";
open STDOUT, ">>__SANDBOX__/log/services/eyebrowse.log";
@


1.3
log
@Fixed improper function call to mkdir.
@
text
@d6 1
a6 1
$ENV{CLASSPATH} = '/usr/lib/java/collections.jar:/usr/lib/java/mysql.jar:/usr/lib/java/mail.jar:/usr/lib/java/gnu-regexp.jar:/usr/lib/java/activation.jar:/usr/lib/java/log4j.jar';
@


1.2
log
@new logging location
@
text
@d17 1
a17 1
    mkdir("__SANDBOX__/log/services") or die "Can't setup log dir , $!";
@


1.1
log
@moved from eyebrowse tree to helm since it is specific to tigris
@
text
@d15 7
a21 2
open STDERR, ">>__SANDBOX__/log/eyebrowse.log";
open STDOUT, ">>__SANDBOX__/log/eyebrowse.log";
@

