--- loncom/build/make_domain_coordinator.pl 2008/01/03 21:16:11 1.14 +++ loncom/build/make_domain_coordinator.pl 2009/07/17 01:11:11 1.16 @@ -11,7 +11,7 @@ make_domain_coordinator.pl - Make a doma # The LearningOnline Network # make_domain_coordinator.pl - Make a domain coordinator on a system # -# $Id: make_domain_coordinator.pl,v 1.14 2008/01/03 21:16:11 raeburn Exp $ +# $Id: make_domain_coordinator.pl,v 1.16 2009/07/17 01:11:11 raeburn Exp $ # # This file is part of the LearningOnline Network with CAPA (LON-CAPA). # @@ -304,9 +304,20 @@ foreach (split(//,$passwd)) {if ((ord($_ if ($pbad) { die('Password must consist of standard ASCII characters'."\n"); } -open(OUT,"|passwd --stdin $username"); -print(OUT $passwd."\n"); -close(OUT); + +my $distro; +if (open(PIPE,"perl distprobe|")) { + $distro = ; + close(PIPE); +} +if ($distro =~ /^ubuntu|debian/) { + open(OUT,"|usermod -p `mkpasswd $passwd` $username"); + close(OUT); +} else { + open(OUT,"|passwd --stdin $username"); + print(OUT $passwd."\n"); + close(OUT); +} =pod @@ -357,7 +368,11 @@ close(OUT); open(OUT, ">$udpath/passwd"); print(OUT 'unix:'."\n"); close(OUT); -`chown www:www $udpath/passwd`; # Must be writeable by httpd process. + +# Get permissions correct on udpath + + print "Setting permissions on user data directories. This may take a moment, please be patient ...\n"; +`chown -R www:www /home/httpd/lonUsers/$domain` ; # Must be writeable by httpd process. =pod