Hello community,

here is the log from the commit of package yast2-fcoe-client for 
openSUSE:Factory checked in at 2014-04-05 14:42:46
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-fcoe-client (Old)
 and      /work/SRC/openSUSE:Factory/.yast2-fcoe-client.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "yast2-fcoe-client"

Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-fcoe-client/yast2-fcoe-client.changes      
2013-12-09 07:27:17.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.yast2-fcoe-client.new/yast2-fcoe-client.changes 
2014-04-05 14:42:47.000000000 +0200
@@ -1,0 +2,6 @@
+Fri Mar 28 13:14:21 CET 2014 - [email protected]
+
+- Adapt start of services (resp. sockets) to systemd
+- 3.1.4
+
+-------------------------------------------------------------------

Old:
----
  yast2-fcoe-client-3.1.3.tar.bz2

New:
----
  yast2-fcoe-client-3.1.4.tar.bz2

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

Other differences:
------------------
++++++ yast2-fcoe-client.spec ++++++
--- /var/tmp/diff_new_pack.TJmZPZ/_old  2014-04-05 14:42:48.000000000 +0200
+++ /var/tmp/diff_new_pack.TJmZPZ/_new  2014-04-05 14:42:48.000000000 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package yast2-fcoe-client
 #
-# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-fcoe-client
-Version:        3.1.3
+Version:        3.1.4
 Release:        0
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
@@ -26,9 +26,10 @@
 Requires:       fcoe-utils
 Requires:       yast2 >= 2.21.22
 BuildRequires:  perl-XML-Writer
+BuildRequires:  rubygem-rspec
 BuildRequires:  update-desktop-files
 BuildRequires:  yast2
-BuildRequires:  yast2-devtools >= 3.0.6
+BuildRequires:  yast2-devtools >= 3.1.10
 BuildRequires:  yast2-testsuite
 
 BuildArch:      noarch

++++++ yast2-fcoe-client-3.1.3.tar.bz2 -> yast2-fcoe-client-3.1.4.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-fcoe-client-3.1.3/VERSION 
new/yast2-fcoe-client-3.1.4/VERSION
--- old/yast2-fcoe-client-3.1.3/VERSION 2013-12-02 14:54:58.000000000 +0100
+++ new/yast2-fcoe-client-3.1.4/VERSION 1970-01-01 01:00:00.000000000 +0100
@@ -1 +0,0 @@
-3.1.3
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-fcoe-client-3.1.3/package/yast2-fcoe-client.changes 
new/yast2-fcoe-client-3.1.4/package/yast2-fcoe-client.changes
--- old/yast2-fcoe-client-3.1.3/package/yast2-fcoe-client.changes       
2013-12-02 14:54:58.000000000 +0100
+++ new/yast2-fcoe-client-3.1.4/package/yast2-fcoe-client.changes       
2014-03-28 13:55:54.000000000 +0100
@@ -1,4 +1,10 @@
 -------------------------------------------------------------------
+Fri Mar 28 13:14:21 CET 2014 - [email protected]
+
+- Adapt start of services (resp. sockets) to systemd
+- 3.1.4
+
+-------------------------------------------------------------------
 Mon Dec  2 11:45:47 CET 2013 - [email protected]
 
 - Enhance help text, improve ruby code
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-fcoe-client-3.1.3/package/yast2-fcoe-client.spec 
new/yast2-fcoe-client-3.1.4/package/yast2-fcoe-client.spec
--- old/yast2-fcoe-client-3.1.3/package/yast2-fcoe-client.spec  2013-12-02 
14:54:58.000000000 +0100
+++ new/yast2-fcoe-client-3.1.4/package/yast2-fcoe-client.spec  2014-03-28 
13:55:54.000000000 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-fcoe-client
-Version:        3.1.3
+Version:        3.1.4
 Release:        0
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
@@ -28,7 +28,8 @@
 Requires:      yast2 >= 2.21.22
 Requires:       fcoe-utils
 BuildRequires: perl-XML-Writer update-desktop-files yast2 yast2-testsuite
-BuildRequires:  yast2-devtools >= 3.0.6
+BuildRequires:  yast2-devtools >= 3.1.10
+BuildRequires:  rubygem-rspec
 
 BuildArchitectures:    noarch
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-fcoe-client-3.1.3/src/clients/fcoe-client_finish.rb 
new/yast2-fcoe-client-3.1.4/src/clients/fcoe-client_finish.rb
--- old/yast2-fcoe-client-3.1.3/src/clients/fcoe-client_finish.rb       
2013-12-02 14:54:58.000000000 +0100
+++ new/yast2-fcoe-client-3.1.4/src/clients/fcoe-client_finish.rb       
2014-03-27 11:25:03.000000000 +0100
@@ -39,6 +39,7 @@
       Yast.import "String"
       Yast.import "FcoeClient"
       Yast.import "Service"
+      Yast.import "SystemdSocket"
       Yast.include self, "installation/misc.rb"
 
       @ret = nil
@@ -131,10 +132,20 @@
         end
 
         if @start_services
-          Builtins.y2milestone("Enabling service start of fcoe and lldpad")
-          # service lldpad has to be enabled first
-          Service.Enable("boot.lldpad")
-          Service.Enable("boot.fcoe")
+          Builtins.y2milestone("Enabling socket start of fcoe and lldpad")
+          # enable socket lldpad first
+          lldpad_socket = SystemdSocket.find("lldpad")
+          if lldpad_socket
+            lldpad_socket.enable
+          else
+            Builtins.y2error("lldpad.socket not found")
+          end
+          fcoemon_socket = SystemdSocket.find("fcoemon")
+          if fcoemon_socket
+            fcoemon_socket.enable
+          else
+            Builtins.y2error("fcoemon.socket not found")
+          end
         end
       else
         Builtins.y2error("unknown function: %1", @func)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-fcoe-client-3.1.3/src/clients/inst_fcoe-client.rb 
new/yast2-fcoe-client-3.1.4/src/clients/inst_fcoe-client.rb
--- old/yast2-fcoe-client-3.1.3/src/clients/inst_fcoe-client.rb 2013-12-02 
14:54:58.000000000 +0100
+++ new/yast2-fcoe-client-3.1.4/src/clients/inst_fcoe-client.rb 2014-03-27 
11:25:03.000000000 +0100
@@ -70,7 +70,6 @@
       FcoeClient.ResetNetworkCards
 
       # start services fcoe and lldpad
-      # (modules for fcoe are loaded in /etc/init.d/fcoe)
       @success = FcoeClient.ServiceStatus
       if !@success
         Builtins.y2error("Starting of services FAILED")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-fcoe-client-3.1.3/src/include/fcoe-client/complex.rb 
new/yast2-fcoe-client-3.1.4/src/include/fcoe-client/complex.rb
--- old/yast2-fcoe-client-3.1.3/src/include/fcoe-client/complex.rb      
2013-12-02 14:54:58.000000000 +0100
+++ new/yast2-fcoe-client-3.1.4/src/include/fcoe-client/complex.rb      
2014-03-27 11:25:03.000000000 +0100
@@ -53,14 +53,16 @@
     def ReallyAbort
       Builtins.y2milestone("Aborting FCoE configuration")
 
-      # revert start of 'fcoe' or 'lldpad'
-      if FcoeClient.fcoe_started && !Service.Enabled("boot.fcoe")
-        Service.Stop("boot.fcoe")
+      # Services started at installation time are stopped on reboot.
+      # Revert start of 'fcoemon' or 'lldpad' socket if started but not needed.
+      if !Stage.initial
+        if FcoeClient.fcoe_started && !FcoeClient.fcoemonSocketEnabled?
+          FcoeClient.fcoemonSocketStop
+        end
+        if FcoeClient.lldpad_started && !FcoeClient.lldpadSocketEnabled?
+          FcoeClient.lldpadSocketStop
+        end
       end
-      if FcoeClient.lldpad_started && !Service.Enabled("boot.lldpad")
-        Service.Stop("boot.lldpad")
-      end
-
       return true if !FcoeClient.Modified
 
       abort = Popup.ReallyAbort(true)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-fcoe-client-3.1.3/src/modules/FcoeClient.rb 
new/yast2-fcoe-client-3.1.4/src/modules/FcoeClient.rb
--- old/yast2-fcoe-client-3.1.3/src/modules/FcoeClient.rb       2013-12-02 
14:54:58.000000000 +0100
+++ new/yast2-fcoe-client-3.1.4/src/modules/FcoeClient.rb       2014-03-27 
11:25:03.000000000 +0100
@@ -32,6 +32,8 @@
 module Yast
   class FcoeClientClass < Module
 
+    include Yast::Logger
+
     FCOE_PKG_NAME = "fcoe-utils"
 
     def main
@@ -50,6 +52,7 @@
       Yast.import "NetworkService"
       Yast.import "String"
       Yast.import "FileUtils"
+      Yast.import "SystemdSocket"
 
       # Data
 
@@ -94,8 +97,8 @@
       @NOT_CONFIGURED = "not configured"
       @NOT_AVAILABLE = "not available"
 
-      @lldpad_started = false # service fcoe was started
-      @fcoe_started = false # service lldpad was started
+      @lldpad_started = false # service lldpad was started
+      @fcoe_started = false # service fcoe was started
 
 
       # Settings: Define all variables needed for configuration of fcoe-client
@@ -112,6 +115,10 @@
       # list of maps containing information about networks cards and VLAN, 
FCoE and DCB status
       @network_interfaces = []
 
+      # systemd sockets
+      @fcoemon_socket = nil
+      @lldpad_socket = nil
+
       FcoeClient()
     end
 
@@ -127,6 +134,132 @@
       nil
     end
 
+    def fcoemonSocketActive?
+      if @fcoemon_socket
+        @fcoemon_socket.active?
+      else
+        log.error("fcoemon.socket not found")
+        false
+      end
+    end
+
+    def fcoemonSocketStart
+      if @fcoemon_socket
+        @fcoemon_socket.start
+      else
+        log.error("fcoemon.socket not found")
+        false
+      end
+    end
+
+    def fcoemonSocketStop
+      if @fcoemon_socket
+        @fcoemon_socket.stop
+     else
+        log.error("fcoemon.socket not found")
+        false
+      end
+    end
+
+    def fcoemonSocketEnabled?
+      if @fcoemon_socket
+        @fcoemon_socket.enabled?
+      else
+        log.error("fcoemon.socket not found")
+        false
+      end
+    end
+
+    def fcoemonSocketDisabled?
+      if @fcoemon_socket
+        @fcoemon_socket.disabled?
+      else
+        log.error("fcoemon.socket not found")
+        false
+      end
+    end
+
+    def fcoemonSocketEnable
+      if @fcoemon_socket
+        @fcoemon_socket.enable
+      else
+        log.error("fcoemon.socket not found")
+        false
+      end
+    end
+
+    def fcoemonSocketDisable
+      if @fcoemon_socket
+        @fcoemon_socket.disable
+      else
+        log.error("fcoemon.socket not found")
+        false
+      end
+    end
+
+    def lldpadSocketActive?
+      if @lldpad_socket
+        @lldpad_socket.active?
+      else
+        log.error("lldpad.socket not found")
+        false
+      end
+    end
+
+    def lldpadSocketStart
+      if @lldpad_socket
+        @lldpad_socket.start
+      else
+        log.error("lldpad.socket not found")
+        false
+      end
+    end
+
+    def lldpadSocketStop
+      if @lldpad_socket
+        @lldpad_socket.stop
+     else
+        log.error("lldpad.socket not found")
+        false
+      end
+    end
+
+    def lldpadSocketEnabled?
+      if @lldpad_socket
+        @lldpad_socket.enabled?
+      else
+        log.error("lldpad.socket not found")
+        false
+      end
+    end
+
+    def lldpadSocketDisabled?
+      if @lldpad_socket
+        @lldpad_socket.disabled?
+      else
+        log.error("lldpad.socket not found")
+        false
+      end
+    end
+
+    def lldpadSocketEnable
+      if @lldpad_socket
+        @lldpad_socket.enable
+      else
+        log.error("lldpad.socket not found")
+        false
+      end
+    end
+
+    def lldpadSocketDisable
+      if @lldpad_socket
+        @lldpad_socket.disable
+      else
+        log.error("lldpad.socket not found")
+        false
+      end
+    end
+
     # Abort function
     # @return [Boolean] return true if abort
     def Abort
@@ -639,29 +772,32 @@
     end
 
     #
-    # Set status of services
+    # Set start status of 'fcoemon' and 'lldpad' sockets
+    #
+    # 'Service' tab is only shown in installed system where
+    # sockets (and systemd) are available.
     #
     def AdjustStartStatus
       fcoe_start = Ops.get(@service_start, "fcoe", false)
       lldpad_start = Ops.get(@service_start, "lldpad", false)
       Builtins.y2milestone(
-        "Setting start of /etc/init.d/boot.fcoe to %1",
+        "Setting start of fcoe to %1",
         fcoe_start
       )
       Builtins.y2milestone(
-        "Setting start of /etc/init.d/lldpad to %1",
+        "Setting start of lldpad to %1",
         lldpad_start
       )
 
       if fcoe_start && lldpad_start
-        Service.Enable("boot.lldpad") # enable 'lldpad' first
-        Service.Enable("boot.fcoe")
+        lldpadSocketEnable             # enable 'lldpad' first
+        fcoemonSocketEnable
       elsif !fcoe_start && lldpad_start
-        Service.Disable("boot.fcoe")
-        Service.Enable("boot.lldpad")
+        fcoemonSocketDisable
+        lldpadSocketEnable
       elsif !fcoe_start && !lldpad_start
-        Service.Disable("boot.fcoe") # disable 'fcoe' first
-        Service.Disable("boot.lldpad")
+        fcoemonSocketDisable            # disable 'fcoe' first
+        lldpadSocketDisable
       end 
       # fcoe_start && !lldpad_start isn't possible -> see complex.ycp 
StoreServicesDialog
 
@@ -684,11 +820,11 @@
     def DetectStartStatus
       status = false
 
-      status = Service.Enabled("boot.fcoe")
+      status = fcoemonSocketEnabled?
       Builtins.y2milestone("Start status of fcoe: %1", status)
       @service_start = Builtins.add(@service_start, "fcoe", status)
 
-      status = Service.Enabled("boot.lldpad")
+      status = lldpadSocketEnabled?
       Builtins.y2milestone("Start status of lldpad: %1", status)
       @service_start = Builtins.add(@service_start, "lldpad", status)
 
@@ -705,46 +841,71 @@
     def ServiceStatus
       success = true
 
-      # Loading of modules in Stage::initial() is not required (like in 
IsciClientLib.ycp, line 523 )
-      # see /etc/init.d/fcoe, line 85 (modprobe fcoe > /dev/null 2>&1)
+      # Loading of modules in Stage::initial() is not required 
+      # (like done in IscsiClientLib)
+      # SLES11 SP3: /etc/init.d/boot.fcoe, line 86 
+      #             (modprobe $SUPPORTED_DRIVERS > /dev/null 2>&1)
+      #             SUPPORTED_DRIVERS from /etc/fcoe/config
+      # SLES12:     Service.Start in inst-sys runs commands from 
+      #             /usr/lib/systemd/system/fcoe.service
+      #             (including modprobe)
       ret = true
 
+      # start services during installation
+      if Stage.initial
+        # start service lldpad first
+        @lldpad_started = Service.Start("lldpad")
+        if @lldpad_started
+          log.info("Service lldpad started")
+        else
+          log.error("Cannot start service lldpad")
+          Report.Error(_("Cannot start service 'lldpad'"))
+          ret = false
+        end
+
+        @fcoe_started = Service.Start("fcoe")
+        if @fcoe_started
+          log.info("Service fcoe started")
+        else
+          log.error("Cannot start service fcoe")
+          Report.Error(_("Cannot start service 'fcoe'"))
+          ret = false
+        end
+
+        return ret
+      end
+
+      # start sockets in installed system
+      @fcoemon_socket = SystemdSocket.find!("fcoemon")
+      @lldpad_socket = SystemdSocket.find!("lldpad")
+
       # first start lldpad
-      if Service.Status("boot.lldpad") != 0
-        success = Service.Start("boot.lldpad")
+      if !lldpadSocketActive?
+        success = lldpadSocketStart
         if success
-          Builtins.y2milestone("Lldpad started (/etc/init.d/boot.lldpad 
start)")
+          log.info("lldpad.socket started")
           @lldpad_started = true
         else
-          Builtins.y2error(
-            "Cannot start service lldpad - '/etc/init.d/boot.lldpad start' 
failed"
-          )
-          Report.Error(
-            "Cannot start service lldpad.\n'/etc/init.d/boot.lldpad start' 
failed"
-          )
+          log.error("Cannot start lldpad.socket")
+          Report.Error(_("Cannot start lldpad systemd socket"))
           ret = false
         end
       else
-        Builtins.y2milestone("Lldpad service is running")
+        log.info("lldpad.socket is already active")
       end
 
-      if Service.Status("boot.fcoe") != 0
-        success = Service.Start("boot.fcoe")
-
+      if !fcoemonSocketActive?
+        success = fcoemonSocketStart
         if success
-          Builtins.y2milestone("FCoE started (/etc/init.d/boot.fcoe start)")
+          log.info("fcoemon.socket started")
           @fcoe_started = true
         else
-          Builtins.y2error(
-            "Cannot start FCoE service - '/etc/init.d/boot.fcoe start' failed"
-          )
-          Report.Error(
-            "Cannot start FCoE service.\n'/etc/init.d/boot.fcoe start' failed"
-          )
+          log.error( "Cannot start fcoemon.socket")
+          Report.Error(_("Cannot start fcoemon systemd socket."))
           ret = false
         end
       else
-        Builtins.y2milestone("FCoE service is running")
+        log.info("fcoemon.socket is already active")
       end
 
       ret
@@ -1245,7 +1406,7 @@
       ret = true
 
       Builtins.y2milestone("Restarting fcoe")
-      ret = Service.Restart("boot.fcoe")
+      ret = Service.Restart("fcoe") 
 
       ret
     end
@@ -1309,15 +1470,16 @@
       return false if PollAbort()
       Progress.NextStage
 
-      # check whether auto start of daemon fcoemon and lldpad is enabled or not
-      DetectStartStatus()
-      # check whether fcoe and lldpad are running and start services if 
required
+      # find sockets fcoemon and lldpad, check whether sockets are active, 
start if required
       start_status = ServiceStatus()
 
       # Error message
       Report.Error(_("Starting of services failed.")) if !start_status
       Builtins.sleep(sl)
 
+      # check whether auto start of daemon fcoemon and lldpad is enabled or not
+      DetectStartStatus()
+
       return false if PollAbort()
       Progress.NextStage
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-fcoe-client-3.1.3/test/DetectNetworkCards_spec.rb 
new/yast2-fcoe-client-3.1.4/test/DetectNetworkCards_spec.rb
--- old/yast2-fcoe-client-3.1.3/test/DetectNetworkCards_spec.rb 2013-11-28 
11:09:36.000000000 +0100
+++ new/yast2-fcoe-client-3.1.4/test/DetectNetworkCards_spec.rb 2014-03-27 
11:25:03.000000000 +0100
@@ -1,3 +1,4 @@
+#! /usr/bin/rspec
 require_relative '../src/modules/FcoeClient'
 
 describe Yast::FcoeClientClass do
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-fcoe-client-3.1.3/test/GetVlanInterfaces_spec.rb 
new/yast2-fcoe-client-3.1.4/test/GetVlanInterfaces_spec.rb
--- old/yast2-fcoe-client-3.1.3/test/GetVlanInterfaces_spec.rb  2013-11-28 
11:09:36.000000000 +0100
+++ new/yast2-fcoe-client-3.1.4/test/GetVlanInterfaces_spec.rb  2014-03-27 
11:25:03.000000000 +0100
@@ -1,3 +1,4 @@
+#! /usr/bin/rspec
 require_relative '../src/modules/FcoeClient'
 
 describe Yast::FcoeClientClass do
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-fcoe-client-3.1.3/test/Makefile.am 
new/yast2-fcoe-client-3.1.4/test/Makefile.am
--- old/yast2-fcoe-client-3.1.3/test/Makefile.am        1970-01-01 
01:00:00.000000000 +0100
+++ new/yast2-fcoe-client-3.1.4/test/Makefile.am        2014-03-27 
11:25:03.000000000 +0100
@@ -0,0 +1,8 @@
+TESTS = \
+  DetectNetworkCards_spec.rb       \
+  GetVlanInterfaces_spec.rb
+
+TEST_EXTENSIONS = .rb
+RB_LOG_COMPILER = rspec
+VERBOSE = 1
+EXTRA_DIST = $(TESTS)

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to