[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 19990206: AFOS feed ingest - v5.0.6? hupsyslog ?



On Tue, 9 Feb 1999, Unidata Support wrote:

> 
> ------- Forwarded Message
> 
> >To: "Glenn P. Davis" <address@hidden>
> >From: "Walter A. Rogers" <address@hidden>
> >Subject: Re: 19990206: AFOS feed ingest - v5.0.6? hupsyslog ? (fwd) 
> >Organization: .
> >Keywords: 199902090412.VAA02655
> 
> Glenn,
> 
> Thanks for the prompt AFOS ingest patch.  After seeing several
> support-ldm notes about this, I new that there had to be something
> amiss in the source.  It's probably been only since the new year
> that NWS sites began trying v5.0.6.  Most rely on earlier versions.
> 
> I wasn't able to successfuly build 5.0.6 from source, instead 
> getting the same compile error that Don Murray noted in his
> message SUBJECT: Installing LDM 5.0.6 under RH Linux 5.1 - point
> 3).  Nonetheless, I'll give it a try again tomorrow.
> 
> Also, it would be nice to have a permanent fix the the ldmd.log
> rotation in hupsyslog.

Walter,

Here's a hupsyslog that should work on the different version on Linux,
etc. I would replace the original with the attached one to this message:

% cp hupsyslog hupsyslog.orig
- get the one from mail message
- as root, make it owned by root and suid root also.  Detail instrustions
on Web page.

Let me know if you have problems.  Did you get a clean LDM build?

Robb...
          

> 
> With the setup documentation now cleaned up .. and the ldmadmin
> ps fix for Linux, things seem to be in good shape.
> 
> Anxiously  awaiting the linux binaries with this AFOS feed patch
> unless I can get a clean compile.
> 
> Walt Rogers
> ZLA CWSU
> 
> 
> ------- End of Forwarded Message
> 

===============================================================================
Robb Kambic                                Unidata Program Center
Software Engineer III                      Univ. Corp for Atmospheric Research
address@hidden             WWW: http://www.unidata.ucar.edu/
===============================================================================
#!/usr/local/bin/perl
#
# File:         hupsyslog.pl
#
# Copyright 1995 University Corporation for Atmospheric Research
# See ../COPYRIGHT file for copying and redistribution conditions.
#
# Description: This perl script provides an alternative to the c code hupsyslog
# and platforms without the /etc/syslog.pid file.
#
# Files:
#
# Environment Variables:
#
# Usage:
#
# hupsyslog.pl
#
###############################################################################

#
# get the existing runtime environment 
#

($os,$hostname,$version) = split(/ /,`uname -a`);
$syslogpid = getPid() ;
#print "$syslogpid\n" ;
system( "kill -HUP $syslogpid" ) ;

###############################################################################

sub getPid {

my( $i, @F, $pid_num ) ;

# looking for the syslogd pid
if ($os eq "SunOS" && $version =~ /^4/) {
        open( IN, "ps -gawxl |" ) || die "ps: Cannot open ps" ;
        $default = 2 ;

} elsif( $os eq "Linux") {
        open( IN, "ps ajx |" ) || die "ps: Cannot open ps" ;
        $default = 1 ;

} else {
        open( IN, "ps -eaf |" ) || die "ps: Cannot open ps" ;
        $default = 1 ;
}
# each platform has fields in different order, looking for PID
$_ = <IN> ;
s/^\s*([A-Z].*)/\1/ ;
$index = -1 ;
( @F ) = split( /[ \t]+/, $_ ) ;
for( $i = 0; $i <= $#F; $i++ ) {
        next if( $F[ $i ] =~ /PPID/i ) ;
        if( $F[ $i ] =~ /PID/i ) {
                $index = $i ;
                last ;
        }
}
$index = $default if( $index == -1 ) ;

@F = ( ) ;
# search through all processes, looking for syslogd
while( <IN> ) {
        next unless( /syslogd/ ) ;
        s/^\s*([a-z0-9].*)/\1/ ;
        ( @F ) = split( /[ \t]+/, $_ ) ;
        last ;
}
close( IN ) ;

# no pid, no syslogd running
return -1 if( $#F == -1 ) ;

return $F[ $index ] ;

}

###############################################################################