Subject: [LON-CAPA-dev] Re: CHECK-RPM messages

From: Stuart Raeburn <[email-masked]>
Date: Mon, 29 Sep 2008 19:03:41 -0400

Mark,

The reason why CHECKRPMS generates this message, but it is not  
generated elsewhere is because CHECKRPMS includes the -w flag:

#!/usr/bin/perl -w

To suppress the warnings for now, you could eliminate the -w flag in line 1 of
/usr/local/loncapa/bin/CHECKRPMS.

However, a better way to eliminate these warnings is to check that  
$protocol (lonnet.pm line 8550) and $defmail (loncommon.pm line 8333)  
are not undef.

lonnet.pm rev 1.969 and loncommon.pm rev 1.679.2.6 implement this check.

It looks as though similar messages to the one you report appear in  
root's mail when CHECKRPMS runs on the servers in the msu domain.  
However, the notification mail about any RPMs which actually need  
updating is generated separately (without these warnings) and goes, as  
usual, directly to the lonAdmin e-mail address (in msu's case to my  
e-mail address).

Stuart Raeburn
MSU LON-CAPA group

> I get the following during CHECK-RPM. Use of uninitialized value in string eq
> at /home/httpd/lib/perl//Apache/lonnet.pm line 8550. (repeated 50+
> times- once for each host)
> Use of uninitialized value in string eq
> at /home/httpd/lib/perl//Apache/lonnet.pm line 8550, <$config> line 4.
> Use of uninitialized value in string ne
> at /home/httpd/lib/perl//Apache/loncommon.pm line 8333.
>
>           my ($id,$domain,$role,$name,$protocol)=split(/:/,$configline);
>             $name=~s/\s//g;
>             if ($id && $domain && $role && $name) {
>                 $hostname{$id}=$name;
>                 push(@{$name_to_host{$name}}, $id);
>                 $hostdom{$id}=$domain;
>                 if ($role eq 'library') { $libserv{$id}=$name; }
>  >>>>           if ($protocol eq 'https') {
>                     $protocol{$id} = $protocol;
>                 } else {
>                     $protocol{$id} = 'http';
>                 }
>             }
>  It used to show up once, but now shows up a bunch of times (Presumably
> it is now iterating over the whole table). It is most likely complaining
> that $protocol doesn't exist since most of us don't have some at the end
> of our host entry. I tried this simple code:
> #!/usr/bin/perl
> use strict;
>
> my $configline="oucapa2:ohiou:library:capa2.phy.ohiou.edu";
> my ($id,$domain,$role,$name,$protocol)=split(/:/,$configline);
> if ($protocol eq 'https') {
>     print "https\n";
> } else {
>     print "http\n";
> }
>
> and it works on my fedora desktop.
>
> Any thoughts as to why this is complaining when it is run using
> CHECKRPMS as an external process?
>
> The failure on loncommon regards a similar situation with defmail.
>
> Anyone else seeing this in their mail from CHECK-RPMS?
>
> Later,
> Mark
> -- 
> Mark Lucas                                      email: [email-masked]
> 252D Clippinger Lab                             phone: (740)597-2984
> Department of Physics and Astronomy             fax:   (740)593-0433
> Ohio University
> Athens, OH 45701
>

---

From: Mark Lucas <[email-masked]>
Date: Tue, 30 Sep 2008 08:07:02 -0400

Stuart,

Thanks - that makes sense now.

> usual, directly to the lonAdmin e-mail address (in msu's case to my  

What happens here is a get the email through lonAdmin with the RPMS, and
then I've been getting this spurious message because I forward root
messages to myself as well.

Later,
Mark