From d33160ee0aeb11aaec474d52bee27be8b533c2ba Mon Sep 17 00:00:00 2001 From: Antoine Ginies Date: Fri, 6 Feb 2004 15:13:55 +0000 Subject: - add wait message - use check_started --- web_wizard/Apache.pm | 46 ++++++++++++++++++++++++++++++++-------------- 1 file changed, 32 insertions(+), 14 deletions(-) diff --git a/web_wizard/Apache.pm b/web_wizard/Apache.pm index 0f28559e..e25f4418 100755 --- a/web_wizard/Apache.pm +++ b/web_wizard/Apache.pm @@ -25,6 +25,7 @@ package MDK::Wizard::Apache; use strict; use common; +use services; use MDK::Wizard::Wizcommon; use MDK::Wizard::Varspaceval; @@ -141,12 +142,19 @@ available on your http server via http://www.yourserver.com/~user."), 70)), type post => \&do_it, next => 'end' }, - end => { - name => N("Congratulations") . "\n\n" . - N("The wizard successfully configured your Intranet/Internet Web Server"), - end => 1, - next => 0 - }, + end => { + name => N("Congratulations") . "\n\n" . + N("The wizard successfully configured your Intranet/Internet Web Server"), + end => 1, + next => 0 + }, + error_end => { + name => N("Failed"), + data => [ { label => N("Relaunch drakwizard, and try to change some parameters.") } ], + no_back => 1, + end => 1, + next => 0, + }, }; sub new { @@ -222,6 +230,9 @@ sub chg_user_dir { sub do_it { $::testing and return; + my $in = 'interactive'->vnew('su', 'Apache'); + my $w = $in->wait_message(N("Apache server"), N("Configuring your system as Apache server ...")); + my $file = "/etc/httpd/conf/commonhttpd.conf"; my $that = "localhost"; @@ -233,14 +244,21 @@ sub do_it { $that .= " 127.0.0.1"; } cp_af($file, $file.".orig"); - substInFile { - if (m/^\s*/s...m!^\s*!s) { - { s/^\s*Allow .*$/ Allow from $that\n/s } - } - } $file; - chg_docroot(); - chg_user_dir(); - system("/etc/rc.d/init.d/httpd restart"); + substInFile { + if (m/^\s*/s...m!^\s*!s) { + { s/^\s*Allow .*$/ Allow from $that\n/s } + } + } $file; + chg_docroot(); + chg_user_dir(); + + if (services::is_service_running('httpd')) { + services::restart('httpd') + } else { + services::start('httpd') + } + undef $w; + check_started('httpd'); } 1; -- cgit v1.2.1