[LON-CAPA-cvs] cvs: doc /install/fedora install.pl
matthew
lon-capa-cvs@mail.lon-capa.org
Thu, 24 Mar 2005 21:42:46 -0000
matthew Thu Mar 24 16:42:46 2005 EDT
Modified files:
/doc/install/fedora install.pl
Log:
Best to use built in routines to get uid of www.
Index: doc/install/fedora/install.pl
diff -u doc/install/fedora/install.pl:1.6 doc/install/fedora/install.pl:1.7
--- doc/install/fedora/install.pl:1.6 Mon Oct 18 15:05:34 2004
+++ doc/install/fedora/install.pl Thu Mar 24 16:42:46 2005
@@ -2,7 +2,7 @@
# The LearningOnline Network
# Fedora installation script
#
-# $Id: install.pl,v 1.6 2004/10/18 19:05:34 matthew Exp $
+# $Id: install.pl,v 1.7 2005/03/24 21:42:46 matthew Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -35,7 +35,7 @@
# note: The filehandle LOG is global.
open LOG,">>loncapa_install.log" || die "Unable to open log file.\n";
-print LOG '$Id: install.pl,v 1.6 2004/10/18 19:05:34 matthew Exp $'."\n";
+print LOG '$Id: install.pl,v 1.7 2005/03/24 21:42:46 matthew Exp $'."\n";
# Some friendly subroutines
sub die_if_nonempty {
@@ -218,14 +218,7 @@
###############################################
###############################################
sub uid_of_www {
- my $num = `grep ^www /etc/passwd | cut -d':' -f3`;
- chomp $num;
- if (int($num) == $num) {
- writelog ("uid of www = $num\n");
- } else {
- die "Unable to determine UID of user www\n Halting.\n";
- }
- print_and_log("\n");
+ my ($num) = (getpwnam('www'))[2];
return $num;
}