koha-cvs
[Top][All Lists]
Advanced

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

[Koha-cvs] CVS: koha/misc Install.pm,1.69.2.4,1.69.2.5


From: MJ Ray
Subject: [Koha-cvs] CVS: koha/misc Install.pm,1.69.2.4,1.69.2.5
Date: Tue, 13 Apr 2004 16:17:12 -0700

Update of /cvsroot/koha/koha/misc
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26583

Modified Files:
      Tag: rel_2_0
        Install.pm 
Log Message:
Fix bug: cannot rely on httpduser=httpdgroup

Index: Install.pm
===================================================================
RCS file: /cvsroot/koha/koha/misc/Install.pm,v
retrieving revision 1.69.2.4
retrieving revision 1.69.2.5
diff -C2 -r1.69.2.4 -r1.69.2.5
*** Install.pm  31 Jan 2004 04:03:45 -0000      1.69.2.4
--- Install.pm  13 Apr 2004 23:17:09 -0000      1.69.2.5
***************
*** 3,7 ****
  
  # Copyright 2000-2002 Katipo Communications
! # Contains parts Copyright 2003 MJ Ray
  #
  # This file is part of Koha.
--- 3,7 ----
  
  # Copyright 2000-2002 Katipo Communications
! # Contains parts Copyright 2003-4 MJ Ray
  #
  # This file is part of Koha.
***************
*** 84,88 ****
  use vars qw( $etcdir );                               # set in installer.pl, 
usu. /etc
  use vars qw( $intranetdir $opacdir $kohalogdir );
! use vars qw( $realhttpdconf $httpduser );
  use vars qw( $servername $svr_admin $opacport $intranetport );
  use vars qw( $mysqldir );
--- 84,88 ----
  use vars qw( $etcdir );                               # set in installer.pl, 
usu. /etc
  use vars qw( $intranetdir $opacdir $kohalogdir );
! use vars qw( $realhttpdconf $httpduser $httpdgroup );
  use vars qw( $servername $svr_admin $opacport $intranetport );
  use vars qw( $mysqldir );
***************
*** 946,950 ****
         mkdir_parents (dirname($intranetdir), 0775) || print 
getmessage('DirFailed',['parents of '.$intranetdir]);
         mkdir ($intranetdir,                  0770) || print 
getmessage('DirFailed',[$intranetdir]);
!        if ($>==0) { chown (oct(0), (getgrnam($httpduser))[2], 
"$intranetdir"); }
         chmod 0770, "$intranetdir";
      }
--- 946,950 ----
         mkdir_parents (dirname($intranetdir), 0775) || print 
getmessage('DirFailed',['parents of '.$intranetdir]);
         mkdir ($intranetdir,                  0770) || print 
getmessage('DirFailed',[$intranetdir]);
!        if ($>==0) { chown (oct(0), (getgrnam($httpdgroup))[2], 
"$intranetdir"); }
         chmod 0770, "$intranetdir";
      }
***************
*** 956,960 ****
         mkdir_parents (dirname($opacdir),     0775) || print 
getmessage('DirFailed',['parents of '.$opacdir]);
         mkdir ($opacdir,                      0770) || print 
getmessage('DirFailed',[$opacdir]);
!        if ($>==0) { chown (oct(0), (getgrnam($httpduser))[2], "$opacdir"); }
         chmod (oct(770), "$opacdir");
      }
--- 956,960 ----
         mkdir_parents (dirname($opacdir),     0775) || print 
getmessage('DirFailed',['parents of '.$opacdir]);
         mkdir ($opacdir,                      0770) || print 
getmessage('DirFailed',[$opacdir]);
!        if ($>==0) { chown (oct(0), (getgrnam($httpdgroup))[2], "$opacdir"); }
         chmod (oct(770), "$opacdir");
      }
***************
*** 966,970 ****
         mkdir_parents (dirname($kohalogdir),  0775) || print 
getmessage('DirFailed',['parents of '.$kohalogdir]);
         mkdir ($kohalogdir,                   0770) || print 
getmessage('DirFailed',[$kohalogdir]);
!        if ($>==0) { chown (oct(0), (getgrnam($httpduser))[2,3], 
"$kohalogdir"); }
         chmod (oct(770), "$kohalogdir");
      }
--- 966,970 ----
         mkdir_parents (dirname($kohalogdir),  0775) || print 
getmessage('DirFailed',['parents of '.$kohalogdir]);
         mkdir ($kohalogdir,                   0770) || print 
getmessage('DirFailed',[$kohalogdir]);
!        if ($>==0) { chown (oct(0), (getgrnam($httpdgroup))[2,3], 
"$kohalogdir"); }
         chmod (oct(770), "$kohalogdir");
      }
***************
*** 1139,1142 ****
--- 1139,1155 ----
  Press <ENTER> to continue: |;
  
+ $messages->{'EnterApacheGroup'}->{en} = heading('NEED APACHE GROUP') . qq\
+ The installer could not find the Group setting in the Apache configuration 
file.
+ This is used to set up access permissions for
+ %s/koha.conf.  This user should be set in one of the Apache configuration.
+ Please try to find it and enter the user name below.  It probably is NOT 
"root".
+ 
+ Enter the Apache userid: \;
+ 
+ $messages->{'InvalidGroupid'}->{en} = heading('INVALID GROUP') . qq|
+ The group %s is not a valid group on this system.
+ 
+ Press <ENTER> to continue: |;
+ 
  sub getapacheinfo {
      my @confpossibilities;
***************
*** 1198,1201 ****
--- 1211,1217 ----
            $httpduser = $1;
        }
+       if (/^\s*Group\s+"?([-\w]+)"?\s*$/) {
+           $httpdgroup = $1;
+       }
      }
      close(HTTPDCONF);
***************
*** 1214,1217 ****
--- 1230,1246 ----
        }
      }
+     unless (defined($httpdgroup)) {
+       my $message=getmessage('EnterApacheGroup', [$etcdir]);
+       until (defined($httpdgroup) && length($httpdgroup) && 
getpwnam($httpdgroup)) {
+           $httpdgroup=showmessage($message, "free", '');
+           if (length($httpdgroup)>0) {
+               unless (getgrnam($httpdgroup)) {
+                   my $message=getmessage('InvalidGroupid', [$httpdgroup]);
+                   showmessage($message,'PressEnter');
+               }
+           } else {
+           }
+       }
+     }
  }
  
***************
*** 1563,1567 ****
        #MJR: is this necessary?
        if ($> == 0) {
!           system("chown -R $httpduser:$httpduser $opacdir $intranetdir");
      }
        system("chmod -R a+rx $opacdir $intranetdir");
--- 1592,1596 ----
        #MJR: is this necessary?
        if ($> == 0) {
!           system("chown -R $httpduser:$httpdgroup $opacdir $intranetdir");
      }
        system("chmod -R a+rx $opacdir $intranetdir");
***************
*** 1581,1584 ****
--- 1610,1614 ----
  kohaversion=$newversion
  httpduser=$httpduser
+ httpdgroup=$httpdgroup
  intrahtdocs=$intranetdir/htdocs/intranet-tmpl
  opachtdocs=$opacdir/htdocs/opac-tmpl




reply via email to

[Prev in Thread] Current Thread [Next in Thread]