--- loncom/Attic/lcuseradd 2006/08/25 21:25:22 1.39 +++ loncom/Attic/lcuseradd 2006/12/05 14:46:04 1.40 @@ -6,7 +6,7 @@ # with adding a user with filesystem privileges (e.g. author) # # -# $Id: lcuseradd,v 1.39 2006/08/25 21:25:22 albertel Exp $ +# $Id: lcuseradd,v 1.40 2006/12/05 14:46:04 raeburn Exp $ ### ############################################################################### @@ -348,9 +348,16 @@ system('/bin/chown','-R',"$safeusername: # system('/bin/chown',"$safeusername:www","/home/$safeusername"); # Now adust top level... # system('/bin/chown','-R',"$safeusername:www","/home/$safeusername/public_html"); # And web dir. # ---------------------------------------------------- Gracefull Apache Restart +my $pidfile; if (-e '/var/run/httpd.pid') { + $pidfile = '/var/run/httpd.pid'; +} elsif (-e '/var/run/httpd2.pid') { #Apache 2 on SuSE 10.1 and SLES10 + $pidfile = '/var/run/httpd2.pid'; +} + +if ($pidfile) { print "lcuseradd Apache restart\n" unless $noprint; - open(PID,'/var/run/httpd.pid'); + open(PID,<$pidfile); my $pid=; close(PID); $pid=~ /(\D+)/;