[yast-commit] r40720 - in /trunk/ntp-client/src: NtpClient.ycp ntp-client_proposal.ycp
Author: kmachalkova Date: Mon Sep 3 16:15:57 2007 New Revision: 40720 URL: http://svn.opensuse.org/viewcvs/yast?rev=40720&view=rev Log: Do not query status/stop/start NTP service during installation (holds for NTP test and ntp proposal client) Modified: trunk/ntp-client/src/NtpClient.ycp trunk/ntp-client/src/ntp-client_proposal.ycp Modified: trunk/ntp-client/src/NtpClient.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/ntp-client/src/NtpClient.ycp?rev=40720&r1=40719&r2=40720&view=diff ============================================================================== --- trunk/ntp-client/src/NtpClient.ycp (original) +++ trunk/ntp-client/src/NtpClient.ycp Mon Sep 3 16:15:57 2007 @@ -25,6 +25,7 @@ import "Report"; import "Service"; import "SLPAPI"; +import "Stage"; import "String"; import "Summary"; import "SuSEFirewall"; @@ -939,9 +940,16 @@ `Left(`Label(_("Testing the NTP server..."))) ); - integer status = Service::Status (service_name); - if (status == 0) - Service::Stop (service_name); + integer status = -1; + //Do not do anything to ntp service during installation + if ( !Stage::initial() ) + { + status = Service::Status (service_name); + //Stop service temporarily (otherwise ntpdate won't work) + //0 means service is running + if ( status == 0); + Service::Stop (service_name); + } y2milestone ("Testing reachability of server %1", server); // testing the server using IPv4 and then using IPv6 protocol @@ -956,8 +964,13 @@ "/usr/sbin/ntpdate -6 -q %1", server )); - if (status == 0) - Service::Start (service_name); + + //Do not do anything to ntp service during installation + if ( !Stage::initial() ) + //Start the service if it was running + if ( status == 0); + Service::Start (service_name); + } UI::CloseDialog(); Modified: trunk/ntp-client/src/ntp-client_proposal.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/ntp-client/src/ntp-client_proposal.ycp?rev=40720&r1=40719&r2=40720&view=diff ============================================================================== --- trunk/ntp-client/src/ntp-client_proposal.ycp (original) +++ trunk/ntp-client/src/ntp-client_proposal.ycp Mon Sep 3 16:15:57 2007 @@ -132,13 +132,17 @@ { y2milestone("Running ntpdate to sync with %1", ntp_server); - integer status = 0; + integer status = -1; string service_name = "ntp"; //Stop NTP service on running system (during 1st stage, we don't care) - if( !Stage::initial() && status == 0) + if( !Stage::initial()) { - Service::Stop(service_name); + status = Service::Status (service_name); + //Stop service temporarily (otherwise ntpdate won't work) + //0 means service is running + if ( status == 0); + Service::Stop (service_name); } //Schedule package for installation @@ -147,9 +151,10 @@ integer r = (integer) SCR::Execute (.target.bash, sformat ("/usr/sbin/ntpdate '%1'", String::Quote(ntp_server))); y2milestone ("'ntpdate %1' returned %2", ntp_server, r); - if( !Stage::initial() && status == 0) + if( !Stage::initial()) { - Service::Start(service_name); + if( status == 0 ) + Service::Start(service_name); } if (r == 0) -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
kmachalkova@svn.opensuse.org