Hello community,

here is the log from the commit of package open-iscsi for openSUSE:Factory 
checked in at 2019-06-13 22:38:37
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/open-iscsi (Old)
 and      /work/SRC/openSUSE:Factory/.open-iscsi.new.4811 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "open-iscsi"

Thu Jun 13 22:38:37 2019 rev:81 rq:709746 version:unknown

Changes:
--------
--- /work/SRC/openSUSE:Factory/open-iscsi/open-iscsi.changes    2019-04-01 
12:33:30.385800266 +0200
+++ /work/SRC/openSUSE:Factory/.open-iscsi.new.4811/open-iscsi.changes  
2019-06-13 22:38:39.700277544 +0200
@@ -1,0 +2,20 @@
+Wed Jun 12 14:24:16 UTC 2019 - Dominique Leuenberger <[email protected]>
+
+- BuildRequire pkgconfig(systemd) instead of systemd: allow OBS to
+  shortcut the build queues by allowing usage of systemd-mini
+
+-------------------------------------------------------------------
+Tue Jun  4 17:45:40 UTC 2019 - Lee Duncan <[email protected]>
+
+- Added latest upstream changes, including:
+  - iscsiuio: Stop using /var directory for PIDfile and locks
+  - iscsiuio: improve daemon synchronization (bsc#1135070)
+  - fix pipe notification code
+  - add systemd support for iscsiuio
+  - make iscsid systemd usage optional
+  - fix possible discovery hang timeout
+  - fix iscsiuio systemd disablement
+  Updating:
+  * open-iscsi-SUSE-latest.diff.bz2
+
+-------------------------------------------------------------------

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

Other differences:
------------------
++++++ open-iscsi.spec ++++++
--- /var/tmp/diff_new_pack.kAo2qH/_old  2019-06-13 22:38:40.240277362 +0200
+++ /var/tmp/diff_new_pack.kAo2qH/_new  2019-06-13 22:38:40.240277362 +0200
@@ -12,7 +12,7 @@
 # license that conforms to the Open Source Definition (Version 1.9)
 # published by the Open Source Initiative.
 
-# Please submit bugfixes or comments via http://bugs.opensuse.org/
+# Please submit bugfixes or comments via https://bugs.opensuse.org/
 #
 
 
@@ -40,8 +40,8 @@
 BuildRequires:  openssl-devel
 BuildRequires:  pkg-config
 BuildRequires:  suse-module-tools
-BuildRequires:  systemd
-BuildRequires:  systemd-devel
+BuildRequires:  pkgconfig(systemd)
+BuildRequires:  pkgconfig(libsystemd)
 Requires(post): coreutils
 Requires:       libopeniscsiusr0_2_0 = %{version}
 %{?systemd_requires}

++++++ open-iscsi-SUSE-latest.diff.bz2 ++++++
--- /var/tmp/diff_new_pack.kAo2qH/_old  2019-06-13 22:38:40.272277351 +0200
+++ /var/tmp/diff_new_pack.kAo2qH/_new  2019-06-13 22:38:40.276277349 +0200
@@ -1,5 +1,5 @@
 diff --git a/Makefile b/Makefile
-index a03b2e687440..2816803264a0 100644
+index a03b2e687440..2539182d3baa 100644
 --- a/Makefile
 +++ b/Makefile
 @@ -20,7 +20,8 @@ rulesdir = $(libdir)/udev/rules.d
@@ -12,6 +12,30 @@
  SCRIPTS = utils/iscsi_discovery utils/iscsi_fw_login utils/iscsi_offload \
                  utils/iscsi-gen-initiatorname
  INSTALL = install
+@@ -41,6 +42,14 @@ ifneq (,$(CFLAGS))
+ export CFLAGS
+ endif
+ 
++# export systemd disablement if set
++ifneq ($(NO_SYSTEMD),)
++export NO_SYSTEMD
++WITHOUT_ARG = --without-systemd
++else
++WITHOUT_ARG =
++endif
++
+ # Random comments:
+ # using '$(MAKE)' instead of just 'make' allows make to run in parallel
+ # over multiple makefile.
+@@ -66,7 +75,7 @@ user: iscsiuio/Makefile
+       @echo "Read README file for detailed information."
+ 
+ iscsiuio/Makefile: iscsiuio/configure iscsiuio/Makefile.in
+-      cd iscsiuio; ./configure
++      cd iscsiuio; ./configure $(WITHOUT_ARG)
+ 
+ iscsiuio/configure iscsiuio/Makefile.in: iscsiuio/configure.ac 
iscsiuio/Makefile.am
+       cd iscsiuio; autoreconf --install
 diff --git a/doc/iscsiadm.8 b/doc/iscsiadm.8
 index a82805e28fb9..bf23dd2e6e27 100644
 --- a/doc/iscsiadm.8
@@ -707,6 +731,74 @@
  .SH AUTHORS
  Open-iSCSI project <http://www.open-iscsi.com/>
  .br
+diff --git a/doc/iscsid.8 b/doc/iscsid.8
+index d6b32ddc42e4..6f9218f74c4c 100644
+--- a/doc/iscsid.8
++++ b/doc/iscsid.8
+@@ -40,7 +40,7 @@ do not write a process ID file.
+ .TP
+ .BI [-p|--pid=]\fIpid\-file\fP
+ write process ID to \fIpid\-file\fR rather than the default
+-\fI/var/run/iscsid.pid\fR
++\fI/run/iscsid.pid\fR
+ .TP
+ .BI [-h|--help]
+ display this help and exit
+diff --git a/etc/initd/initd.debian b/etc/initd/initd.debian
+index 59bf59b8f495..b531be5f8574 100644
+--- a/etc/initd/initd.debian
++++ b/etc/initd/initd.debian
+@@ -11,7 +11,7 @@
+ PATH=/sbin:/bin:/usr/sbin:/usr/bin
+ DAEMON=/sbin/iscsid
+ ADM=/sbin/iscsiadm
+-PIDFILE=/var/run/iscsid.pid
++PIDFILE=/run/iscsid.pid
+ 
+ [ -x "$DAEMON" ] || exit 0
+ 
+diff --git a/etc/initd/initd.redhat b/etc/initd/initd.redhat
+index d14908269395..568f0cf95a2e 100644
+--- a/etc/initd/initd.redhat
++++ b/etc/initd/initd.redhat
+@@ -4,7 +4,7 @@
+ # description: Starts and stops the iSCSI initiator
+ #
+ # processname: iscsid
+-# pidfile: /var/run/iscsid.pid
++# pidfile: /run/iscsid.pid
+ # config:  /etc/iscsi/iscsid.conf
+ 
+ # Source function library.
+@@ -23,7 +23,7 @@ start()
+       echo
+       [ $RETVAL -eq 0 ] || return
+ 
+-      touch /var/lock/subsys/open-iscsi
++      touch /run/lock/subsys/open-iscsi
+ 
+       echo -n $"Setting up iSCSI targets: "
+       iscsiadm -m node --loginall=automatic
+@@ -43,8 +43,8 @@ stop()
+               return $RETVAL
+       fi
+       iscsiadm -k 0
+-      rm -f /var/run/iscsid.pid
+-      [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/open-iscsi
++      rm -f /run/iscsid.pid
++      [ $RETVAL -eq 0 ] && rm -f /run/lock/subsys/open-iscsi
+       status=0
+       modprobe -r iscsi_tcp 2>/dev/null
+       if [ "$?" -ne "0" -a "$?" -ne "1" ]; then
+@@ -94,7 +94,7 @@ case "$1" in
+                       RETVAL=$?
+                       ;;
+       condrestart)
+-                      [ -f /var/lock/subsys/open-iscsi ] && restart
++                      [ -f /run/lock/subsys/open-iscsi ] && restart
+                       ;;
+       *)
+                       echo $"Usage: $0 
{start|stop|restart|status|condrestart}"
 diff --git a/etc/systemd/iscsi.service b/etc/systemd/iscsi.service
 index 0edcf510b9cb..e4758881cb9c 100644
 --- a/etc/systemd/iscsi.service
@@ -737,6 +829,25 @@
  
  [Install]
  WantedBy=multi-user.target
+diff --git a/etc/systemd/iscsiuio.service b/etc/systemd/iscsiuio.service
+index 21757fffeb61..e4d9fd0f916a 100644
+--- a/etc/systemd/iscsiuio.service
++++ b/etc/systemd/iscsiuio.service
+@@ -9,9 +9,11 @@ After=network.target
+ Before=remote-fs-pre.target iscsid.service
+ 
+ [Service]
+-Type=forking
+-PIDFile=/var/run/iscsiuio.pid
+-ExecStart=/sbin/iscsiuio
++Type=notify
++NotifyAccess=main
++ExecStart=/sbin/iscsiuio -f
++KillMode=mixed
++Restart=on-failure
+ 
+ [Install]
+ WantedBy=multi-user.target
 diff --git a/iscsiuio/README b/iscsiuio/README
 index 9cbf7ce6717a..19150055a3fb 100644
 --- a/iscsiuio/README
@@ -795,7 +906,7 @@
  uIP v0.7.8.4 (Feb 22, 2018)
  =======================================================
 diff --git a/iscsiuio/configure.ac b/iscsiuio/configure.ac
-index fa67ea74c47a..ae23078aa0a3 100644
+index fa67ea74c47a..096573b47f94 100644
 --- a/iscsiuio/configure.ac
 +++ b/iscsiuio/configure.ac
 @@ -12,9 +12,9 @@ dnl             Benjamin Li  ([email protected])
@@ -810,6 +921,34 @@
  
  AM_INIT_AUTOMAKE
  AC_CONFIG_HEADER(config.h)
+@@ -63,6 +63,14 @@ AC_ARG_ENABLE(debug,
+         CFLAGS="${CFLAGS} -g -O0"
+     fi])
+ AM_CONDITIONAL([DEBUG], [test x$debug = xtrue])
++## check for systemd support, default on
++AC_ARG_WITH([systemd],
++          AS_HELP_STRING([--without-systemd], [Build without systemd]),
++    [case "${withval}" in
++     yes) LDFLAGS="`pkg-config --libs libsystemd`" ;;
++     no)  CFLAGS="${CFLAGS} -DNO_SYSTEMD" ;;
++     *)   AC_MSG_ERROR([bad value $withval for --with-systemd]) ;;
++     esac],[LDFLAGS="`pkg-config --libs libsystemd`"])
+ 
+ AC_CONFIG_COMMANDS([default],[[
+     if [ -n "$SOURCE_DATE_EPOCH" ] ; then
+diff --git a/iscsiuio/docs/iscsiuio.8 b/iscsiuio/docs/iscsiuio.8
+index eda20c76637f..ea2ae027246a 100644
+--- a/iscsiuio/docs/iscsiuio.8
++++ b/iscsiuio/docs/iscsiuio.8
+@@ -71,7 +71,7 @@ This is to print the version.
+ .PP
+ .TP
+ .BI -p|--pid <pidfile>
+-Use pidfile (default  /var/run/iscsiuio.pid )
++Use pidfile (default  /run/iscsiuio.pid )
+ .PP
+ .TP
+ .BI -h|--help
 diff --git a/iscsiuio/src/unix/libs/qedi.c b/iscsiuio/src/unix/libs/qedi.c
 index 3aa2de7155e8..b7595d5223eb 100644
 --- a/iscsiuio/src/unix/libs/qedi.c
@@ -846,6 +985,148 @@
                LOG_DEBUG(PFX "%s: clearing rx interrupt: %d %d",
                          nic->log_name, sw_cons, hw_prod);
                rc = 1;
+diff --git a/iscsiuio/src/unix/logger.c b/iscsiuio/src/unix/logger.c
+index d41f9e8b6e43..87e16cd66525 100644
+--- a/iscsiuio/src/unix/logger.c
++++ b/iscsiuio/src/unix/logger.c
+@@ -135,7 +135,7 @@ int init_logger(char *filename)
+       }
+       main_log.fp = fopen(filename, "a");
+       if (main_log.fp == NULL) {
+-              printf("Could not create log file: %s <%s>\n",
++              fprintf(stderr, "WARN: Could not create log file: %s <%s>\n",
+                      filename, strerror(errno));
+               rc = -EIO;
+       }
+diff --git a/iscsiuio/src/unix/main.c b/iscsiuio/src/unix/main.c
+index 39d533926732..5168e4ef2f66 100644
+--- a/iscsiuio/src/unix/main.c
++++ b/iscsiuio/src/unix/main.c
+@@ -48,6 +48,9 @@
+ #include <net/ethernet.h>
+ #include <arpa/inet.h>
+ #include <sys/mman.h>
++#ifndef       NO_SYSTEMD
++#include <systemd/sd-daemon.h>
++#endif
+ 
+ #include "uip.h"
+ #include "uip_arp.h"
+@@ -76,7 +79,7 @@
+  
******************************************************************************/
+ #define PFX "main "
+ 
+-static const char default_pid_filepath[] = "/var/run/iscsiuio.pid";
++static const char default_pid_filepath[] = "/run/iscsiuio.pid";
+ 
+ 
/*******************************************************************************
+  *  Global Variables
+@@ -146,7 +149,7 @@ signal_wait:
+               fini_logger(SHUTDOWN_LOGGER);
+               rc = init_logger(main_log.log_file);
+               if (rc != 0)
+-                      printf("Could not initialize the logger in "
++                      fprintf(stderr, "WARN: Could not initialize the logger 
in "
+                              "signal!\n");
+               goto signal_wait;
+       default:
+@@ -239,6 +242,7 @@ int main(int argc, char *argv[])
+       int foreground = 0;
+       pid_t pid;
+       pthread_attr_t attr;
++      int pipefds[2];
+ 
+       /*  Record the start time for the user space daemon */
+       opt.start_time = time(NULL);
+@@ -281,7 +285,7 @@ int main(int argc, char *argv[])
+               /*  initialize the logger */
+               rc = init_logger(main_log.log_file);
+               if (rc != 0 && opt.debug == DEBUG_ON)
+-                      printf("WARN: Could not initialize the logger\n");
++                      fprintf(stderr, "WARN: Could not initialize the 
logger\n");
+       }
+ 
+       LOG_INFO("Started iSCSI uio stack: Ver " PACKAGE_VERSION);
+@@ -316,38 +320,53 @@ int main(int argc, char *argv[])
+ 
+               fd = open(pid_file, O_WRONLY | O_CREAT, 0644);
+               if (fd < 0) {
+-                      printf("Unable to create pid file: %s", pid_file);
++                      fprintf(stderr, "ERR: Unable to create pid file: %s\n",
++                              pid_file);
++                      exit(1);
++              }
++
++              if (pipe(pipefds) < 0) {
++                      fprintf(stderr, "ERR: Unable to create a PIPE: %s\n",
++                              strerror(errno));
+                       exit(1);
+               }
+ 
+               pid = fork();
+               if (pid < 0) {
+-                      printf("Starting daemon failed");
++                      fprintf(stderr, "ERR: Starting daemon failed\n");
+                       exit(1);
+               } else if (pid) {
++                      char msgbuf[4];
++
++                      /* parent: wait for child msg then exit */
++                      close(pipefds[1]);
++                      read(pipefds[0], msgbuf, sizeof(msgbuf));
+                       exit(0);
+               }
+ 
++              /* the child */
+               rc = chdir("/");
+               if (rc == -1)
+-                      printf("Unable to chdir(\") [%s]", strerror(errno));
++                      fprintf(stderr, "WARN: Unable to chdir(\") [%s]\n", 
strerror(errno));
+ 
+               if (lockf(fd, F_TLOCK, 0) < 0) {
+-                      printf("Unable to lock pid file: %s [%s]",
++                      fprintf(stderr, "ERR: Unable to lock pid file: %s 
[%s]\n",
+                              pid_file, strerror(errno));
+                       exit(1);
+               }
+ 
+               rc = ftruncate(fd, 0);
+               if (rc == -1)
+-                      printf("ftruncate(%d, 0) failed [%s]",
++                      fprintf(stderr, "WARN: ftruncate(%d, 0) failed [%s]\n",
+                              fd, strerror(errno));
+ 
+               sprintf(buf, "%d\n", getpid());
+               written_bytes = write(fd, buf, strlen(buf));
+-              if (written_bytes == -1)
+-                      printf("Could not write pid file [%s]",
++              if (written_bytes == -1) {
++                      fprintf(stderr, "ERR: Could not write pid file [%s]\n",
+                              strerror(errno));
++                      exit(1);
++              }
+               close(fd);
+ 
+               daemon_init();
+@@ -393,6 +412,18 @@ int main(int argc, char *argv[])
+       if (rc != 0)
+               goto error;
+ 
++      if (!foreground) {
++              /* signal parent they can go away now */
++              close(pipefds[0]);
++              write(pipefds[1], "ok\n", 3);
++              close(pipefds[1]);
++      }
++
++#ifndef       NO_SYSTEMD
++      sd_notify(0, "READY=1\n"
++                   "STATUS=Ready to process requests\n");
++#endif
++
+       /*  NetLink connection to listen to NETLINK_ISCSI private messages */
+       if (nic_nl_open() != 0)
+               goto error;
 diff --git a/iscsiuio/src/unix/nic.c b/iscsiuio/src/unix/nic.c
 index dfc2ad0a7a7b..bd415c2446bc 100644
 --- a/iscsiuio/src/unix/nic.c
@@ -915,9 +1196,18 @@
  check: $(LIBS) $(TESTS)
        sudo env LD_LIBRARY_PATH=$(LIBISCSI_USR_DIR) TESTS="$(TESTS)" \
 diff --git a/libopeniscsiusr/idbm.c b/libopeniscsiusr/idbm.c
-index 7724de2668bc..677139e86ced 100644
+index 7724de2668bc..d020e6ce4cf4 100644
 --- a/libopeniscsiusr/idbm.c
 +++ b/libopeniscsiusr/idbm.c
+@@ -93,7 +93,7 @@
+ #define ISCSI_END_REC "# END RECORD"
+ 
+ #ifndef LOCK_DIR
+-#define LOCK_DIR              "/var/lock/iscsi"
++#define LOCK_DIR              "/run/lock/iscsi"
+ #endif
+ #define LOCK_FILE             LOCK_DIR"/lock"
+ #define LOCK_WRITE_FILE               LOCK_DIR"/lock.write"
 @@ -676,7 +676,7 @@ updated:
        if (!passwd_done && !strcmp(#_param, name)) { \
                passwd_done = 1; \
@@ -938,10 +1228,10 @@
              rc, out);
  
 diff --git a/usr/Makefile b/usr/Makefile
-index f541d7cb0362..1326a444cdbd 100644
+index f541d7cb0362..42ce6f0cfe1c 100644
 --- a/usr/Makefile
 +++ b/usr/Makefile
-@@ -32,10 +32,16 @@ IPC_OBJ=ioctl.o
+@@ -32,11 +32,19 @@ IPC_OBJ=ioctl.o
  endif
  endif
  
@@ -953,12 +1243,15 @@
          -I$(TOPDIR)/libopeniscsiusr
 +CFLAGS += $(shell $(PKG_CONFIG) --cflags libkmod)
 +CFLAGS += $(shell $(PKG_CONFIG) --cflags libsystemd)
+ ISCSI_LIB = -L$(TOPDIR)/libopeniscsiusr -lopeniscsiusr
 +LDFLAGS += $(shell $(PKG_CONFIG) --libs libkmod)
++ifeq ($(NO_SYSTEMD),)
 +LDFLAGS += $(shell $(PKG_CONFIG) --libs libsystemd)
- ISCSI_LIB = -L$(TOPDIR)/libopeniscsiusr -lopeniscsiusr
++endif
  PROGRAMS = iscsid iscsiadm iscsistart
  
-@@ -60,14 +66,14 @@ all: $(PROGRAMS)
+ # libc compat files
+@@ -60,14 +68,14 @@ all: $(PROGRAMS)
  
  iscsid: $(ISCSI_LIB_SRCS) $(INITIATOR_SRCS) $(DISCOVERY_SRCS) \
        iscsid.o session_mgmt.o discoveryd.o mntcheck.o
@@ -976,6 +1269,18 @@
  
  clean:
        rm -f *.o $(PROGRAMS) .depend $(LIBSYS)
+diff --git a/usr/discovery.c b/usr/discovery.c
+index 2147deb2eda1..199c1601ebf7 100644
+--- a/usr/discovery.c
++++ b/usr/discovery.c
+@@ -1355,6 +1355,7 @@ reconnect:
+       if (--session->reopen_cnt < 0) {
+               log_error("connection login retries (reopen_max) %d exceeded",
+                         config->reopen_max);
++              rc = ISCSI_ERR_PDU_TIMEOUT;
+               goto login_failed;
+       }
+ 
 diff --git a/usr/idbm.c b/usr/idbm.c
 index a0207e2d1c3b..89a6c2722ed4 100644
 --- a/usr/idbm.c
@@ -1033,6 +1338,22 @@
                value = passwd_len; \
                goto setup_passwd_len; \
        }
+diff --git a/usr/initiator.h b/usr/initiator.h
+index 841590add61a..eccafb906ad8 100644
+--- a/usr/initiator.h
++++ b/usr/initiator.h
+@@ -38,9 +38,9 @@
+ #define CONFIG_FILE           ISCSI_CONFIG_ROOT"iscsid.conf"
+ #define INITIATOR_NAME_FILE   ISCSI_CONFIG_ROOT"initiatorname.iscsi"
+ 
+-#define PID_FILE              "/var/run/iscsid.pid"
++#define PID_FILE              "/run/iscsid.pid"
+ #ifndef LOCK_DIR
+-#define LOCK_DIR              "/var/lock/iscsi"
++#define LOCK_DIR              "/run/lock/iscsi"
+ #endif
+ #define LOCK_FILE             LOCK_DIR"/lock"
+ #define LOCK_WRITE_FILE               LOCK_DIR"/lock.write"
 diff --git a/usr/iscsiadm.c b/usr/iscsiadm.c
 index 25c6cdc0ff12..a8f6f4a9a6e4 100644
 --- a/usr/iscsiadm.c
@@ -1111,3 +1432,43 @@
        if (info_level == 1)
                print_nodes_tree(nodes, node_count, _PRINT_MODE_NODE);
        else
+diff --git a/usr/iscsid.c b/usr/iscsid.c
+index 0c9844092505..37c13b396b2c 100644
+--- a/usr/iscsid.c
++++ b/usr/iscsid.c
+@@ -34,7 +34,9 @@
+ #include <sys/wait.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
++#ifndef       NO_SYSTEMD
+ #include <systemd/sd-daemon.h>
++#endif
+ 
+ #include "iscsid.h"
+ #include "mgmt_ipc.h"
+@@ -339,6 +341,7 @@ static void missing_iname_warn(char *initiatorname_file)
+ /* called right before we enter the event loop */
+ static void set_state_to_ready(void)
+ {
++#ifndef       NO_SYSTEMD
+       if (sessions_to_recover)
+               sd_notify(0, "READY=1\n"
+                               "RELOADING=1\n"
+@@ -346,14 +349,17 @@ static void set_state_to_ready(void)
+       else
+               sd_notify(0, "READY=1\n"
+                               "STATUS=Ready to process requests\n");
++#endif
+ }
+ 
+ /* called when recovery process has been reaped */
+ static void set_state_done_reloading(void)
+ {
++#ifndef       NO_SYSTEMD
+       sessions_to_recover = 0;
+       sd_notifyf(0, "READY=1\n"
+                       "STATUS=Ready to process requests\n");
++#endif
+ }
+ 
+ int main(int argc, char *argv[])


Reply via email to