CVS: ispman/lib http.lib,1.46,1.47

Joerg Delker <[email protected]>
Newsgroups gmane.comp.isp.ispman.cvs
Message-ID <[email protected]>
Update of /cvsroot/ispman/ispman/lib
In directory sc8-pr-cvs1:/tmp/cvs-serv28645

Modified Files:
	http.lib 
Log Message:
Fixed bug #734938 (Should perform Apache config check before reloading)


Index: http.lib
===================================================================
RCS file: /cvsroot/ispman/ispman/lib/http.lib,v
retrieving revision 1.46
retrieving revision 1.47
diff -C2 -r1.46 -r1.47
*** http.lib	28 Dec 2003 19:00:56 -0000	1.46
--- http.lib	8 Jan 2004 22:45:02 -0000	1.47
***************
*** 4,13 ****
  $apacheVhostsFooter         = $ispman->getConf("apacheVhostsFooter");
  
- $apacheReloadCommand        = $ispman->getConf("apacheReloadCommand");
- $apacheStopCommand          = $ispman->getConf("apacheStopCommand");
- $apacheStartCommand         = $ispman->getConf("apacheStartCommand");
- $sleepSecondsBetweenRestart = $ispman->getConf("sleepSecondsBetweenRestart");
- 
- 
  if ($ispman->getConf("apacheVhostsStyle") =~ /dir/m) {
     my $vhostConfFile = $apacheVhostsFile;
--- 4,7 ----
***************
*** 370,384 ****
  
  sub reloadApache {
!    if ($apacheReloadCommand) {
         print "Reloading Apache\n";
!        system($apacheReloadCommand);
     } else {
        print "Stopping Apache\n";
!       system($apacheStopCommand);
        sleep $sleepSecondsBetweenRestart ;
        print "Starting Apache\n";
!       system($apacheStartCommand);
     }
!    print $?;
  }
  
--- 364,391 ----
  
  sub reloadApache {
!    my $apacheGracefulCommand      = $ispman->getConf("apacheGracefulCommand");
!    my $apacheReloadCommand        = $ispman->getConf("apacheReloadCommand");
!    my $apacheStopCommand          = $ispman->getConf("apacheStopCommand");
!    my $apacheStartCommand         = $ispman->getConf("apacheStartCommand");
!    my $sleepSecondsBetweenRestart = $ispman->getConf("sleepSecondsBetweenRestart");
! 
!    if ($apacheGracefulCommand) {
!        print "Graceful restarting Apache\n";
!        print `$apacheGracefulCommand`;
!    } elsif ($apacheReloadCommand) {
         print "Reloading Apache\n";
!        print `$apacheReloadCommand`;
     } else {
        print "Stopping Apache\n";
!       print `$apacheStopCommand`;
        sleep $sleepSecondsBetweenRestart ;
        print "Starting Apache\n";
!       print `$apacheStartCommand`;
     }
! 
!    my $rc=$?;
!    print "rc=" . $rc . "\n";
! 
!    return $rc>0 ? 0 : 1;
  }
  



-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.