Hello community,

here is the log from the commit of package yast2-nfs-client for 
openSUSE:Leap:15.2 checked in at 2020-02-10 16:41:24
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Leap:15.2/yast2-nfs-client (Old)
 and      /work/SRC/openSUSE:Leap:15.2/.yast2-nfs-client.new.26092 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "yast2-nfs-client"

Mon Feb 10 16:41:24 2020 rev:41 rq:772190 version:4.2.7

Changes:
--------
--- /work/SRC/openSUSE:Leap:15.2/yast2-nfs-client/yast2-nfs-client.changes      
2020-02-04 17:54:42.360759649 +0100
+++ 
/work/SRC/openSUSE:Leap:15.2/.yast2-nfs-client.new.26092/yast2-nfs-client.changes
   2020-02-10 16:41:30.919705947 +0100
@@ -1,0 +2,7 @@
+Thu Feb  6 15:29:51 UTC 2020 - José Iván López González <[email protected]>
+
+- Kill rpcbind process if it was directly executed without using
+  systemd (bsc#1161687).
+- 4.2.7
+
+-------------------------------------------------------------------

Old:
----
  yast2-nfs-client-4.2.6.tar.bz2

New:
----
  yast2-nfs-client-4.2.7.tar.bz2

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ yast2-nfs-client.spec ++++++
--- /var/tmp/diff_new_pack.e4dSiM/_old  2020-02-10 16:41:31.239706173 +0100
+++ /var/tmp/diff_new_pack.e4dSiM/_new  2020-02-10 16:41:31.243706176 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-nfs-client
-Version:        4.2.6
+Version:        4.2.7
 Release:        0
 Url:            https://github.com/yast/yast-nfs-client
 Summary:        YaST2 - NFS Configuration
@@ -30,8 +30,8 @@
 BuildRequires:  update-desktop-files
 BuildRequires:  yast2-devtools >= 4.2.2
 BuildRequires:  yast2-testsuite
-# SuSEFirewall2 replaced by firewalld (fate#323460)
-BuildRequires:  yast2 >= 4.0.39
+# Yast::Execute.locally
+BuildRequires:  yast2 >= 4.1.42
 BuildRequires:  rubygem(%{rb_default_ruby_abi}:rspec)
 #for install task
 BuildRequires:  rubygem(%rb_default_ruby_abi:yast-rake)
@@ -46,8 +46,8 @@
 BuildRequires:  rubygem(%{rb_default_ruby_abi}:yast-rake-ci)
 %endif
 
-# SuSEFirewall2 replaced by firewalld (fate#323460)
-Requires:       yast2 >= 4.0.39
+# Yast::Execute.locally
+BuildRequires:  yast2 >= 4.1.42
 #idmapd_conf agent
 Requires:       yast2-nfs-common >= 2.24.0
 # showmount, #150382, #286300

++++++ yast2-nfs-client-4.2.6.tar.bz2 -> yast2-nfs-client-4.2.7.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-nfs-client-4.2.6/package/yast2-nfs-client.changes 
new/yast2-nfs-client-4.2.7/package/yast2-nfs-client.changes
--- old/yast2-nfs-client-4.2.6/package/yast2-nfs-client.changes 2020-01-24 
14:43:03.000000000 +0100
+++ new/yast2-nfs-client-4.2.7/package/yast2-nfs-client.changes 2020-02-06 
17:11:38.000000000 +0100
@@ -1,4 +1,11 @@
 -------------------------------------------------------------------
+Thu Feb  6 15:29:51 UTC 2020 - José Iván López González <[email protected]>
+
+- Kill rpcbind process if it was directly executed without using
+  systemd (bsc#1161687).
+- 4.2.7
+
+-------------------------------------------------------------------
 Thu Jan 23 15:41:17 UTC 2020 - Josef Reidinger <[email protected]>
 
 - fix return code for cli `yast2 nfs list` (bsc#1150070)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-nfs-client-4.2.6/package/yast2-nfs-client.spec 
new/yast2-nfs-client-4.2.7/package/yast2-nfs-client.spec
--- old/yast2-nfs-client-4.2.6/package/yast2-nfs-client.spec    2020-01-24 
14:43:03.000000000 +0100
+++ new/yast2-nfs-client-4.2.7/package/yast2-nfs-client.spec    2020-02-06 
17:11:38.000000000 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-nfs-client
-Version:        4.2.6
+Version:        4.2.7
 Release:        0
 Url:            https://github.com/yast/yast-nfs-client
 Summary:        YaST2 - NFS Configuration
@@ -30,8 +30,8 @@
 BuildRequires:  update-desktop-files
 BuildRequires:  yast2-devtools >= 4.2.2
 BuildRequires:  yast2-testsuite
-# SuSEFirewall2 replaced by firewalld (fate#323460)
-BuildRequires:  yast2 >= 4.0.39
+# Yast::Execute.locally
+BuildRequires:  yast2 >= 4.1.42
 BuildRequires:  rubygem(%{rb_default_ruby_abi}:rspec)
 #for install task
 BuildRequires:  rubygem(%rb_default_ruby_abi:yast-rake)
@@ -46,8 +46,8 @@
 BuildRequires: rubygem(%{rb_default_ruby_abi}:yast-rake-ci)
 %endif
 
-# SuSEFirewall2 replaced by firewalld (fate#323460)
-Requires:       yast2 >= 4.0.39
+# Yast::Execute.locally
+BuildRequires:  yast2 >= 4.1.42
 #idmapd_conf agent
 Requires:       yast2-nfs-common >= 2.24.0
 # showmount, #150382, #286300
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-nfs-client-4.2.6/src/modules/Nfs.rb 
new/yast2-nfs-client-4.2.7/src/modules/Nfs.rb
--- old/yast2-nfs-client-4.2.6/src/modules/Nfs.rb       2020-01-24 
14:43:03.000000000 +0100
+++ new/yast2-nfs-client-4.2.7/src/modules/Nfs.rb       2020-02-06 
17:11:38.000000000 +0100
@@ -19,6 +19,7 @@
 
 require "yast"
 require "y2firewall/firewalld"
+require "yast2/execute"
 
 require "shellwords"
 
@@ -384,15 +385,10 @@
       # help text
       Wizard.RestoreHelp(_("Writing NFS client settings. Please wait..."))
 
-      if Ops.greater_than(Builtins.size(@nfs_entries), 0)
+      if @nfs_entries.any?
         Progress.NextStage
-        # portmap must not be started if it is running already (see bug # 9999)
-        Service.Start(@portmapper) unless Service.active?(@portmapper)
 
-        unless Service.active?(@portmapper)
-          Report.Error(Message.CannotStartService(@portmapper))
-          return false
-        end
+        return false unless start_portmapper
       end
 
       firewalld.reload
@@ -697,6 +693,28 @@
 
       true
     end
+
+    # Starts portmapper service
+    #
+    # @return [Boolean] true if the service was activated; false otherwise.
+    def start_portmapper
+      if !Service.active?(@portmapper)
+        # Before mounting NFS shares, libstorage-ng could execute rpcbind 
binary directly without using
+        # systemd. If so, the systemd service would look like stopped and 
systemd would fail when trying
+        # to start it. The following line ensures that the process is not 
running before systemd tries to
+        # starts the service (bsc#1161687).
+        Yast::Execute.locally.stdout("killall", @portmapper)
+
+        # portmap must not be started if it is already running (bsc#9999)
+        Service.Start(@portmapper)
+      end
+
+      return true if Service.active?(@portmapper)
+
+      Report.Error(Message.CannotStartService(@portmapper))
+
+      false
+    end
   end
 
   Nfs = NfsClass.new
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-nfs-client-4.2.6/test/nfs_test.rb 
new/yast2-nfs-client-4.2.7/test/nfs_test.rb
--- old/yast2-nfs-client-4.2.6/test/nfs_test.rb 2020-01-24 14:43:03.000000000 
+0100
+++ new/yast2-nfs-client-4.2.7/test/nfs_test.rb 2020-02-06 17:11:38.000000000 
+0100
@@ -462,11 +462,14 @@
       allow(Yast::Service).to receive(:Start)
       allow(Yast::Service).to receive(:Stop)
       allow(Yast::Service).to receive(:active?)
+      allow(Yast::Execute).to receive(:locally).and_return(execute_object)
 
       allow_read_side_effects
       mock_entries
     end
 
+    let(:execute_object) { instance_double(Yast::Execute, stdout: "") }
+
     let(:written) { false }
 
     it "writes the nfs configurations" do
@@ -477,26 +480,66 @@
     context "when the configuration is written correctly" do
       let(:written) { true }
 
-      it "tries to start the portmapper service if it is not running" do
-        expect(Yast::Service).to 
receive(:active?).with("rpcbind").and_return(false)
-        expect(Yast::Service).to receive(:Start).with("rpcbind")
-        subject.Write()
+      before do
+        allow(Yast::Service).to receive(:active?).with("rpcbind")
+          .and_return(service_status1, service_status2)
       end
 
-      context "and the portmapper service was not activated" do
-        before do
-          allow(Yast::Service).to 
receive(:active?).with("rpcbind").twice.and_return(false)
-          allow(Yast::Message).to 
receive(:CannotStartService).and_return("cannot_start")
+      let(:service_status1) { nil }
+
+      let(:service_status2) { nil }
+
+      context "and the portmapper service is not active" do
+        let(:service_status1) { false }
+
+        it "tries to kill the portmapper process" do
+          expect(execute_object).to receive(:stdout).with("killall", "rpcbind")
+
+          subject.Write
         end
 
-        it "reports an error" do
-          expect(Yast::Report).to receive(:Error).with("cannot_start")
+        it "tries to activate the portmapper service" do
+          expect(Yast::Service).to receive(:Start).with("rpcbind")
+
+          subject.Write
+        end
+
+        context "and the portmapper service was activated" do
+          let(:service_status2) { true }
+
+          it "returns true" do
+            expect(subject.Write).to eql(true)
+          end
+        end
+
+        context "and the portmapper service was not activated" do
+          let(:service_status2) { false }
+
+          it "reports an error" do
+            expect(Yast::Report).to receive(:Error).with(/Cannot start/)
+
+            subject.Write
+          end
+
+          it "returns false" do
+            expect(subject.Write).to eql(false)
+          end
+        end
+      end
+
+      context "and the portmapper service is already active" do
+        let(:service_status1) { true }
+
+        let(:service_status2) { true }
+
+        it "does not try to activate the portmapper service again" do
+          expect(Yast::Service).to_not receive(:Start).with("rpcbind")
 
           subject.Write
         end
 
-        it "returns false" do
-          expect(subject.Write).to eql(false)
+        it "returns true" do
+          expect(subject.Write).to eql(true)
         end
       end
     end


Reply via email to