[LON-CAPA-cvs] Re: loncom /metadata_database searchcat.pl

Scott Harrison lon-capa-cvs@mail.lon-capa.org
Sat, 4 Jan 2003 13:32:08 -0500


searchcat.pl is only invoked in one location that I can find,
which is loncapa/loncom/cron/loncapa

I think it is most reasonable to:
* have scripts that must run as 'www' error-check themselves in
  the beginning
* sanity check against misconfigured machines

Announcing:
http://bugs.lon-capa.org/show_bug.cgi?id=1122

On Sat, Jan 04, 2003 at 12:19:41PM -0500, Gerd Kortemeyer wrote:
> Or could it be that searchcat.pl was run as root during install and/or postinstall?
> 
> Gerd Kortemeyer wrote:
> 
> > Actually, for now, on misconfigured machines, searchcat.pl needs to run at least one more time as
> > root in order to repair its own damage.
> >
> > Gerd Kortemeyer wrote:
> >
> > > Apparently not on s10 - there is no other way that the ownership of this file could have changed
> > > to "root".
> > >
> > > Anyway, in case that more machines are configured like s10 for some odd reason, the chown line can
> > > still stay. Should work fine for www to change ownership to itself.
> > >
> > > Scott Harrison wrote:
> > >
> > > > searchcat.pl is set to run as 'www'.
> > > >
> > > > 10 1 * * 7    www    /home/httpd/perl/searchcat.pl
> > > >
> > > > It would be better to have the script
> > > > first ask itself 'am I www?' before proceeding.
> > > >
> > > > On Sat, Jan 04, 2003 at 03:04:13PM -0000, www wrote:
> > > > > www           Sat Jan  4 10:04:13 2003 EDT
> > > > >
> > > > >   Modified files:
> > > > >     /loncom/metadata_database searchcat.pl
> > > > >   Log:
> > > > >   Bug #1111
> > > > >   searchcat.pl is apparently running as "root" and changed ownership on
> > > > >   nohist_resevaldata.db to "root". Need to make "www" owner of that file.
> > > > >   This should go into 0.6.1
> > > > >
> > > > >
> > > > >
> > > > > Index: loncom/metadata_database/searchcat.pl
> > > > > diff -u loncom/metadata_database/searchcat.pl:1.25 loncom/metadata_database/searchcat.pl:1.26
> > > > > --- loncom/metadata_database/searchcat.pl:1.25        Mon Nov 18 15:44:15 2002
> > > > > +++ loncom/metadata_database/searchcat.pl     Sat Jan  4 10:04:12 2003
> > > > > @@ -2,7 +2,7 @@
> > > > >  # The LearningOnline Network
> > > > >  # searchcat.pl "Search Catalog" batch script
> > > > >  #
> > > > > -# $Id: searchcat.pl,v 1.25 2002/11/18 20:44:15 www Exp $
> > > > > +# $Id: searchcat.pl,v 1.26 2003/01/04 15:04:12 www Exp $
> > > > >  #
> > > > >  # Copyright Michigan State University Board of Trustees
> > > > >  #
> > > > > @@ -251,6 +251,7 @@
> > > > >  # -------------------------------------------------- Copy over the new db-files
> > > > >      system('mv '.$prodir.'/nohist_new_resevaldata.db '.
> > > > >                $prodir.'/nohist_resevaldata.db');
> > > > > +    system('chown www:www '.$prodir.'/nohist_resevaldata.db');
> > > > >  }
> > > > >  # --------------------------------------------------- Close database connection
> > > > >  $dbh->disconnect;
> > > > >
> > > > >
> > > > > _______________________________________________
> > > > > LON-CAPA-cvs mailing list
> > > > > LON-CAPA-cvs@mail.lon-capa.org
> > > > > http://mail.lon-capa.org/mailman/listinfo/lon-capa-cvs
> > > >
> > > > --
> > > > Scott Harrison, sharrison@users.sourceforge.net
> > > > _______________________________________________
> > > > LON-CAPA-cvs mailing list
> > > > LON-CAPA-cvs@mail.lon-capa.org
> > > > http://mail.lon-capa.org/mailman/listinfo/lon-capa-cvs
> > >
> > > _______________________________________________
> > > LON-CAPA-cvs mailing list
> > > LON-CAPA-cvs@mail.lon-capa.org
> > > http://mail.lon-capa.org/mailman/listinfo/lon-capa-cvs

-- 
Scott Harrison, sharrison@users.sourceforge.net