[LON-CAPA-cvs] cvs: loncom / lcuseradd

raeburn lon-capa-cvs@mail.lon-capa.org
Tue, 05 Dec 2006 14:46:04 -0000


raeburn		Tue Dec  5 09:46:04 2006 EDT

  Modified files:              
    /loncom	lcuseradd 
  Log:
  The default filename for the httpd PID file for Apache 2 on SuSE is /var/run/httpd2.pid 
  
  In the future, setting PidFile explicitly in Apache 2 configuration during install is expected to be a better long term solution.
  
  
Index: loncom/lcuseradd
diff -u loncom/lcuseradd:1.39 loncom/lcuseradd:1.40
--- loncom/lcuseradd:1.39	Fri Aug 25 17:25:22 2006
+++ loncom/lcuseradd	Tue Dec  5 09:46:04 2006
@@ -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',"$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=<PID>;
     close(PID);
     $pid=~ /(\D+)/;