Hello community,

here is the log from the commit of package iscsitarget.4966 for 
openSUSE:13.1:Update checked in at 2016-04-28 16:00:39
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:13.1:Update/iscsitarget.4966 (Old)
 and      /work/SRC/openSUSE:13.1:Update/.iscsitarget.4966.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "iscsitarget.4966"

Changes:
--------
New Changes file:

--- /dev/null   2016-04-07 01:36:33.300037506 +0200
+++ /work/SRC/openSUSE:13.1:Update/.iscsitarget.4966.new/iscsitarget.changes    
2016-04-28 16:00:40.000000000 +0200
@@ -0,0 +1,317 @@
+-------------------------------------------------------------------
+Tue Jul 16 08:50:06 PDT 2013 - [email protected]
+
+- Removed startup script hacking on sysconfig files, removed upstream
+  in v0.4.16 (bnc#827441)
+
+-------------------------------------------------------------------
+Fri May 31 12:24:52 UTC 2013 - [email protected]
+
+- fixed compilation against kernel 3.9: iscsitarget-kernel-3.9.patch
+
+-------------------------------------------------------------------
+Tue Mar 26 19:21:40 PDT 2013 - [email protected]
+
+- added post-install spec-file script to ensure user config-file
+  changes not lost (bnc#811533)
+
+-------------------------------------------------------------------
+Wed Jan 23 16:15:45 UTC 2013 - [email protected]
+
+- fix build for kernel 3.7: netlink_kernel_create() api changed and
+  netlink_skb_parms.pid got renamed to .portid
+
+-------------------------------------------------------------------
+Tue Oct 30 19:02:00 UTC 2012 - [email protected]
+
+- fixed service file to use correct PIDFILE (bnc#743562)
+- added missing ietadm.8 man page (bnc#760919)
+- move ietd.conf to /etc/iet, as per upstream
+- deliver initiators.{allow,deny} and targets.allow
+  in /etc/iet: needed to work correctly
+
+-------------------------------------------------------------------
+Sun Oct 28 13:29:29 UTC 2012 - [email protected]
+
+- Modified iscsitarget-kernel-3.5.patch to match upstream version.
+
+- Added iscsitarget-kernel-3.6.0.patch: fixes compilation issue
+  in 3.6 kernel: netlink_kernel_create() API changed
+
+-------------------------------------------------------------------
+Mon Aug 27 11:47:22 UTC 2012 - [email protected]
+
+- Add iscsitarget-kernel-3.5.patch to fix compilation with kernel
+  3.5 : ioc_task_link now returns void.
+
+-------------------------------------------------------------------
+Sun Apr 22 17:23:39 UTC 2012 - [email protected]
+
+- Update to svn trunk, r480, which identifies itself as 0.4.20.3
+  + Fix build with latest kernels.
+
+-------------------------------------------------------------------
+Mon Sep  5 12:19:32 UTC 2011 - [email protected]
+
+- Update to current svn to fix build with newer kernels.
+
+-------------------------------------------------------------------
+Wed Dec  8 16:04:26 UTC 2010 - [email protected]
+
+- fix build with 2.6.37
+
+-------------------------------------------------------------------
+Tue Sep 21 11:35:57 UTC 2010 - [email protected]
+
+- fix install for service file
+  o {S:4} not S{:3}
+
+-------------------------------------------------------------------
+Mon Sep 13 15:37:29 UTC 2010 - [email protected]
+
+- added sysconfig file
+  o IET_OPTS for DAEMON 
+- updated init script
+- merge with 11.3:Update
+  (Fixup bounds checking for iSNS (bnc#618574)
+
+-------------------------------------------------------------------
+Thu Aug  5 11:45:33 CEST 2010 - [email protected]
+
+- Fixup bounds checking for iSNS (bnc#618574)
+
+-------------------------------------------------------------------
+Wed Mar 10 18:01:35 CET 2010 - [email protected]
+
+- fix build with 2.6.33 
+
+-------------------------------------------------------------------
+Wed Mar 10 17:28:54 CET 2010 - [email protected]
+
+- update to 1.4.19
+  o re-enable MaxSessions parameter
+  o code cleanups
+  o NOP-In support
+  o add notes about cross compilation to README
+  o fix ietadm manpage
+  o fix initiators/targets.allow bugs
+  o fix compiler warnings
+  o fix return value of session_add()
+  o update RPM specfile improving RedHat and SuSE compatibility
+    (based on a patch from Matthew Wild)
+  o update RELEASE NOTES
+  o fix session cleanup in case of -EPIPE during login
+
+- update to 1.4.18
+  o improve IETs procfs support to allow a larger number of targets
+  o compatibility fix for 2.6.28 (independently also provided by Francois
+    Micaux)
+  o ignore SIGPIPE in ietd
+  o allow cleanup of stale targets in the kernel module
+  o support for a global worker threadpool instead of per target pools
+    (configurable via the worker_thread_pool_size module parameter)
+  o compatibility fixes for 2.6.30, 2.6.29
+  o in cooperation with Xie Gang: Unit Attention support (thanks to Stefan
+    Rubner for spotting a bug)
+  o in cooperation with Shreyansh Jain: support for splitting text messages 
into
+    several PDUs, allowing more targets to be reported during discovery
+    (thanks to Cheng Rengquan for bugfixes)
+  o clean up all connections, sessions and targets in the kernel module if the
+    daemon is gone
+  o rework sense data handling, plugging memleaks
+  o fix valgrind warnings of uses of uninitialized variables
+  o support for Reject PDUs (thanks to FUJITA Tomonori for a bugfix)
+  o fix SERVICE ACTION IN: IET only supports READ CAPACITY 16, return sense 
data
+    for all others
+  o allow READ CAPACITY even if a LU is RESERVEd
+  o iSNS: report the actual target port instead of the default iSCSI port
+  o fix list corruption if target thread creation fails
+  o fix stopping of threads that have never been awakened before
+  o fix CHAP account handling bugs
+  o fix netlink socket cleanup
+  o code cleanups
+  o remove superfluous linefeed from debug messages
+  o enable runtime switching of debug levels for the kernel module and
+    provide description for the module's debug flags parameter
+  o return proper status class in case of login failures
+  o support more than one portal per target during discovery, and allow
+    configuration of the presented portals using targets.allow - previously 
only
+    the incoming interface was reported (thanks to David Shirley for
+    reporting a bug)
+  o deprecate initiators.allow
+  o regex based filtering in initiators.allow and targets.allow
+  o move config files to /etc/iet
+  o add version and author info and description to kernel module
+  o fix debug log levels
+  o fix ietd.conf permissions
+  o move kernel module to /lib/modules/<kver>/extra where it belongs
+  o improve init scripts, using common names and functions across distributions
+  o improve usage comments in ietd.conf
+  o specfile to build RPMs, including weak module support
+  o DKMS support
+  o Use the LU's sector size in the format mode page instead of defaulting to 
512
+ 
+-------------------------------------------------------------------
+Fri Jun 12 15:21:46 CEST 2009 - [email protected]
+
+- fix build with glibc 2.10
+
+-------------------------------------------------------------------
+Mon Jun  8 01:00:47 CEST 2009 - [email protected]
+
+- fix build with 2.6.30 
+
+-------------------------------------------------------------------
+Mon Apr 20 01:30:47 CEST 2009 - [email protected]
+
+- fix build with current kernel 2.6.29
+  - NIP4 and NIP6 are repaced by special printf pointer formats
+  - open_bdev_excl and close_bdev_excl renamed to _exclusive
+
+-------------------------------------------------------------------
+Mon Apr 20 01:18:25 CEST 2009 - [email protected]
+
+- update to 0.4.17
+  o handle the \0-termination of strings properly when building iSNS TLVs
+  o fix stopping of wthreads that have never been awakened
+  o fix debugging code that hexdumps PDU content to the syslog
+  o avoid busy looping if a connection's socket is out of wmem
+  o add support for "ietadm --op show --user"
+  o SCSI fixes: MODE SENSE handling, INQUIRY CmdDt, HiSup, WCE and RCD handling
+  o fix handling of NOP-Out w/ ping data
+  o fix compilation against glibc >= 2.8
+  o fix potential NULL-pointer derefences and resource leaks in the LUN param
+    parsing code
+  o documentation updates
+  o 2.6.26 and SLES compile fix
+  o SLES 10 SP2 compat patch
+  o make needlessly global function static
+
+- update to 0.4.16 
+  o fix overzealous assert() in digest_data()
+  o add checking on return value of ISCSI_PARAM_GET
+  o 2.6.22, 2.6.23 and 2.6.24 compile fixes
+  o add conn->rwsize check
+  o avoid potential NULL-ptr dereferences in rx and tx buffer
+  o fix the shell syntax in init scripts
+  o fix digest endieness on LE archs
++++ 120 more lines (skipped)
++++ between /dev/null
++++ and 
/work/SRC/openSUSE:13.1:Update/.iscsitarget.4966.new/iscsitarget.changes

New:
----
  iscsitarget-1.4.20.3-svn.tar.bz2
  iscsitarget-kernel-3.5.patch
  iscsitarget-kernel-3.6.0.patch
  iscsitarget-kernel-3.7.patch
  iscsitarget-kernel-3.9.patch
  iscsitarget.changes
  iscsitarget.init
  iscsitarget.spec
  iscsitarget.sysconfig
  preamble
  services

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

Other differences:
------------------
++++++ iscsitarget.spec ++++++
#
# spec file for package iscsitarget
#
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# 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/
#


Name:           iscsitarget
BuildRequires:  kernel-syms
BuildRequires:  module-init-tools
BuildRequires:  openssl-devel
Url:            http://iscsitarget.sourceforge.net
PreReq:         %fillup_prereq %insserv_prereq /bin/cat /bin/rm
Version:        1.4.20.3
Release:        0
Requires:       iscsitarget-kmp
Summary:        Open Source iSCSI Target with Professional Features
License:        GPL-2.0
Group:          System/Daemons
Source:         %{name}-%{version}-svn.tar.bz2
Source1:        %{name}.init
Source2:        %{name}.sysconfig
Source3:        preamble
Source4:        services
Patch1:         iscsitarget-kernel-3.5.patch
Patch2:         iscsitarget-kernel-3.6.0.patch
Patch3:         iscsitarget-kernel-3.7.patch
Patch4:         iscsitarget-kernel-3.9.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%suse_kernel_module_package -n %{name} -p %{S:3} kdump um

%description
The aim of the project is to develop an open source iSCSI target with
professional features that works well in enterprise environment under
real workload and is scalable and versatile enough to meet the
challenge of future storage needs and developments.

%package KMP
Summary:        Open Source iSCSI Target with Professional Features
License:        LGPL-2.1+
Group:          System/Daemons

%description KMP
The aim of the project is to develop an open source iSCSI target with
professional features that works well in enterprise environment under
real workload and is scalable and versatile enough to meet the
challenge of future storage needs and developments.

%prep
%setup -q -n %name-%version-svn
%if 0%{?suse_version} > 1220
%patch1 -p1
%patch2 -p1
%patch3 -p1
%if 0%{?suse_version} > 1230
%patch4
%endif
%endif
echo "iscsi_trgt.ko yes" > kernel/Module.supported

%build
%{__make} CFLAGS="${RPM_OPT_FLAGS} -D_GNU_SOURCE -I../include" bindir=/usr/sbin 
-C usr
for flavor in %flavors_to_build; do
        rm -rf obj/$flavor
        mkdir -p obj/$flavor
        cp -a kernel/* obj/$flavor
        cp include/iet_u.h obj/$flavor
        make -C /usr/src/linux-obj/%_target_cpu/$flavor modules \
              M=$PWD/obj/$flavor
done

%install
install -vD usr/ietd ${RPM_BUILD_ROOT}/usr/sbin/ietd
install -vD usr/ietadm ${RPM_BUILD_ROOT}/usr/sbin/ietadm
install -vD -m 600 etc/ietd.conf ${RPM_BUILD_ROOT}/etc/iet/ietd.conf
install -vD -m 600 etc/initiators.allow 
${RPM_BUILD_ROOT}/etc/iet/initiators.allow
install -vD -m 600 etc/initiators.deny ${RPM_BUILD_ROOT}/etc/iet/initiators.deny
install -vD -m 600 etc/targets.allow ${RPM_BUILD_ROOT}/etc/iet/targets.allow
install -vD -m 755 %{S:1} ${RPM_BUILD_ROOT}/etc/init.d/iscsitarget
install -vD -m 644 %{S:2} 
${RPM_BUILD_ROOT}/var/adm/fillup-templates/sysconfig.ietd
install -vD -m 644 %{S:4} 
${RPM_BUILD_ROOT}/etc/sysconfig/SuSEfirewall2.d/services/iscsitarget
install -D -m 644 doc/manpages/ietd.8 ${RPM_BUILD_ROOT}%{_mandir}/man8/ietd.8
install -D -m 644 doc/manpages/ietadm.8 
${RPM_BUILD_ROOT}%{_mandir}/man8/ietadm.8
install -D -m 644 doc/manpages/ietd.conf.5 
${RPM_BUILD_ROOT}%{_mandir}/man5/ietd.conf.5
ln -sf ../../etc/init.d/iscsitarget $RPM_BUILD_ROOT/usr/sbin/rciscsitarget
# install kernel modules
export INSTALL_MOD_PATH=$RPM_BUILD_ROOT
export INSTALL_MOD_DIR=updates
for flavor in %flavors_to_build; do
        make -C /usr/src/linux-obj/%_target_cpu/$flavor modules_install \
              M=$PWD/obj/$flavor
done

%clean
[ "${RPM_BUILD_ROOT}" != "/" -a -d ${RPM_BUILD_ROOT} ] && rm -rf 
${RPM_BUILD_ROOT}
rm -f filelist

%post
%{fillup_and_insserv -f iscsitarget}
%{fillup_and_insserv -i -n ietd}
# make sure we do not loose previous user config
if [ -f /etc/ietd.conf ] && \
    egrep -qv '^[[:space:]]*(#.*|)$' /etc/ietd.conf ; then
    # old config file has user modifications
    if [ -f /etc/iet/ietd.conf ] && \
        egrep -qv '^[[:space:]]*(#.*|)$' /etc/iet/ietd.conf ; then
        # new file has modification as well
        echo "Two ietd.conf files found. Check /etc/ietd.conf.save"
        mv -f /etc/ietd.conf /etc/ietd.conf.save
    else
        # move old config file to new location
        mv -f /etc/iet/ietd.conf /etc/iet/ietd.conf.installed
        mv -f /etc/ietd.conf /etc/iet/ietd.conf
    fi
else
    # old config file is missing or empty -- make sure it is gone
    rm -f /etc/ietd.conf
fi
ln -sf /etc/iet/ietd.conf /etc/ietd.conf

%preun
%stop_on_removal iscsitarget

%postun
%{insserv_cleanup}
[ -L /etc/ietd.conf ] && rm -f /etc/ietd.conf

%files
%attr(755,root,root)/usr/sbin/*
%attr(755,root,root)/etc/init.d/*
%defattr(-,root,root)
%dir /etc/iet
%config /etc/iet/ietd.conf
%config /etc/iet/initiators.allow
%config /etc/iet/initiators.deny
%config /etc/iet/targets.allow
%config /etc/sysconfig/SuSEfirewall2.d/services/*
/var/adm/fillup-templates/sysconfig.ietd
%doc COPYING README
%doc %{_mandir}/man5/*
%doc %{_mandir}/man8/*

%changelog
++++++ iscsitarget-kernel-3.5.patch ++++++
From:   Arne Redlich <[email protected]>

Signed-off-by: Arne Redlich <[email protected]>
Signed-off-by: Lee Duncan <[email protected]>
---
 Makefile                     |    4 ++++
 kernel/wthread.c             |    5 ++++-
 patches/compat-3.2-3.4.patch |   22 ++++++++++++++++++++++
 3 files changed, 30 insertions(+), 1 deletion(-)
 create mode 100644 patches/compat-3.2-3.4.patch

diff --git a/Makefile b/Makefile
index 996f645..a3dd653 100644
--- a/Makefile
+++ b/Makefile
@@ -66,6 +66,10 @@ kver_lk = $(shell [ `echo $(KVER) | egrep $(1)` ] && echo 1 
|| echo 0)
 # base first the earlier patch sets will not need to be modified.
 #
 
+ifeq ($(call kver_le,3,4,0),1)
+       PATCHES := $(PATCHES) compat-3.2-3.4.patch
+endif
+
 ifeq ($(call kver_le,3,2,0),1)
        PATCHES := $(PATCHES) compat-2.6.39-3.2.patch
 endif
diff --git a/kernel/wthread.c b/kernel/wthread.c
index 940de9d..55d7321 100644
--- a/kernel/wthread.c
+++ b/kernel/wthread.c
@@ -65,13 +65,16 @@ static int worker_thread(void *arg)
        struct worker_thread_info *info = wt->w_info;
        struct iscsi_cmnd *cmnd;
        struct iscsi_conn *conn;
+
        DECLARE_WAITQUEUE(wait, current);
 
        if (current->io_context)
                put_io_context(current->io_context);
 
-       if (!(current->io_context = ioc_task_link(info->wthread_ioc)))
+       if (!info->wthread_ioc)
                info->wthread_ioc = get_task_io_context(current, GFP_KERNEL, 
-1);
+       ioc_task_link(info->wthread_ioc);
+       current->io_context = info->wthread_ioc;
 
        add_wait_queue(&info->wthread_sleep, &wait);
 
diff --git a/patches/compat-3.2-3.4.patch b/patches/compat-3.2-3.4.patch
new file mode 100644
index 0000000..09160ea
--- /dev/null
+++ b/patches/compat-3.2-3.4.patch
@@ -0,0 +1,22 @@
+diff --git b/kernel/wthread.c a/kernel/wthread.c
+index 55d7321..940de9d 100644
+--- b/kernel/wthread.c
++++ a/kernel/wthread.c
+@@ -65,16 +65,13 @@ static int worker_thread(void *arg)
+       struct worker_thread_info *info = wt->w_info;
+       struct iscsi_cmnd *cmnd;
+       struct iscsi_conn *conn;
+-
+       DECLARE_WAITQUEUE(wait, current);
+ 
+       if (current->io_context)
+               put_io_context(current->io_context);
+ 
+-      if (!info->wthread_ioc)
++      if (!(current->io_context = ioc_task_link(info->wthread_ioc)))
+               info->wthread_ioc = get_task_io_context(current, GFP_KERNEL, 
-1);
+-      ioc_task_link(info->wthread_ioc);
+-      current->io_context = info->wthread_ioc;
+ 
+       add_wait_queue(&info->wthread_sleep, &wait);
+ 
-- 
1.7.9.5
++++++ iscsitarget-kernel-3.6.0.patch ++++++
From:   Arne Redlich <[email protected]>

Signed-off-by: Arne Redlich <[email protected]>
Signed-off-by: Lee Duncan <[email protected]>
---
 Makefile                 |    4 ++++
 kernel/event.c           |   13 +++++++++++--
 patches/compat-3.5.patch |   24 ++++++++++++++++++++++++
 3 files changed, 39 insertions(+), 2 deletions(-)
 create mode 100644 patches/compat-3.5.patch

diff --git a/Makefile b/Makefile
index a3dd653..df41642 100644
--- a/Makefile
+++ b/Makefile
@@ -66,6 +66,10 @@ kver_lk = $(shell [ `echo $(KVER) | egrep $(1)` ] && echo 1 
|| echo 0)
 # base first the earlier patch sets will not need to be modified.
 #
 
+ifeq ($(call kver_le,3,5,0),1)
+       PATCHES := $(PATCHES) compat-3.5.patch
+endif
+
 ifeq ($(call kver_le,3,4,0),1)
        PATCHES := $(PATCHES) compat-3.2-3.4.patch
 endif
diff --git a/kernel/event.c b/kernel/event.c
index 0266101..1c5f3a4 100644
--- a/kernel/event.c
+++ b/kernel/event.c
@@ -68,8 +68,17 @@ int event_send(u32 tid, u64 sid, u32 cid, u32 state, int 
atomic)
 
 int event_init(void)
 {
-       nl = netlink_kernel_create(&init_net, NETLINK_IET, 1, event_recv_skb,
-                                  NULL, THIS_MODULE);
+       struct netlink_kernel_cfg cfg = {
+               .groups = 1,
+               .input = event_recv_skb,
+               .cb_mutex = NULL,
+               .bind = NULL,
+       };
+
+       nl = netlink_kernel_create(&init_net,
+                                  NETLINK_IET,
+                                  THIS_MODULE,
+                                  &cfg);
        if (!nl)
                return -ENOMEM;
        else
diff --git a/patches/compat-3.5.patch b/patches/compat-3.5.patch
new file mode 100644
index 0000000..638131e
--- /dev/null
+++ b/patches/compat-3.5.patch
@@ -0,0 +1,24 @@
+diff --git b/kernel/event.c a/kernel/event.c
+index 1c5f3a4..0266101 100644
+--- b/kernel/event.c
++++ a/kernel/event.c
+@@ -68,17 +68,8 @@ int event_send(u32 tid, u64 sid, u32 cid, u32 state, int 
atomic)
+ 
+ int event_init(void)
+ {
+-      struct netlink_kernel_cfg cfg = {
+-              .groups = 1,
+-              .input = event_recv_skb,
+-              .cb_mutex = NULL,
+-              .bind = NULL,
+-      };
+-
+-      nl = netlink_kernel_create(&init_net,
+-                                 NETLINK_IET,
+-                                 THIS_MODULE,
+-                                 &cfg);
++      nl = netlink_kernel_create(&init_net, NETLINK_IET, 1, event_recv_skb,
++                                 NULL, THIS_MODULE);
+       if (!nl)
+               return -ENOMEM;
+       else
-- 
1.7.9.5
++++++ iscsitarget-kernel-3.7.patch ++++++
Index: b/kernel/event.c
===================================================================
--- a/kernel/event.c
+++ b/kernel/event.c
@@ -24,11 +24,11 @@ static void event_recv_skb(struct sk_buf
                if (nlh->nlmsg_len < sizeof(*nlh) || skb->len < nlh->nlmsg_len)
                        break;
                rlen = NLMSG_ALIGN(nlh->nlmsg_len);
                if (rlen > skb->len)
                        rlen = skb->len;
-               ietd_pid = NETLINK_CB(skb).pid;
+               ietd_pid = NETLINK_CB(skb).portid;
                WARN_ON(ietd_pid == 0);
                if (nlh->nlmsg_flags & NLM_F_ACK)
                        netlink_ack(skb, nlh, 0);
                skb_pull(skb, rlen);
        }
@@ -75,11 +75,10 @@ int event_init(void)
                .bind = NULL,
        };
 
        nl = netlink_kernel_create(&init_net,
                                   NETLINK_IET,
-                                  THIS_MODULE,
                                   &cfg);
        if (!nl)
                return -ENOMEM;
        else
                return 0;
++++++ iscsitarget-kernel-3.9.patch ++++++
Index: kernel/config.c
===================================================================
--- kernel/config.c.orig
+++ kernel/config.c
@@ -34,7 +34,7 @@ void iet_procfs_exit(void)
        for (i = 0; i < ARRAY_SIZE(iet_proc_entries); i++)
                remove_proc_entry(iet_proc_entries[i].name, proc_iet_dir);
 
-       remove_proc_entry(proc_iet_dir->name, proc_iet_dir->parent);
+       remove_proc_entry("iet", init_net.proc_net);
 }
 
 int iet_procfs_init(void)
@@ -46,10 +46,8 @@ int iet_procfs_init(void)
                goto err;
 
        for (i = 0; i < ARRAY_SIZE(iet_proc_entries); i++) {
-               ent = create_proc_entry(iet_proc_entries[i].name, 0, 
proc_iet_dir);
-               if (ent)
-                       ent->proc_fops = iet_proc_entries[i].fops;
-               else
+               ent = proc_create(iet_proc_entries[i].name, 0, proc_iet_dir, 
iet_proc_entries[i].fops);
+               if (!ent)
                        goto err;
        }
 
++++++ iscsitarget.init ++++++
#!/bin/sh
#
# /etc/init.d/iscsitarget
#
### BEGIN INIT INFO
# Provides:          iscsitarget
# Required-Start:    $remote_fs $network
# Should-Start:
# Required-Stop:     $remote_fs $network
# Should-Stop:
# Default-Start:     3 5
# Default-Stop:      
# Short-Description: iSCSI target daemon
# Description:
# Script to start and stop the iSCSI target daemon
### END INIT INFO

CONFIG=/etc/iet/ietd.conf
PIDFILE=/var/run/ietd.pid

# Check for missing binaries (stale symlinks should not happen)
# Note: Special treatment of stop for LSB conformance
DAEMON=/usr/sbin/ietd
test -x $DAEMON || { echo "$DAEMON not installed";
        if [ "$1" = "stop" ]; then exit 0;
        else exit 5; fi; }

# Check for existence of needed config file and read it
SYSCONFIG=/etc/sysconfig/ietd
test -r $SYSCONFIG || { echo "$SYSCONFIG not existing";
        if [ "$1" = "stop" ]; then exit 0;
        else exit 6; fi; }

# Read config   
. $SYSCONFIG

# some defaults
OPTS=${IETD_OPTS:=""}

# Source LSB init functions
. /etc/rc.status

# Reset status of this service
rc_reset

PATH=/sbin:/bin:/usr/sbin:/usr/bin

case "$1" in
    start)
        echo -n "Starting iSCSI target service: "
        modprobe -q crc32c
        modprobe iscsi_trgt
        ## Start daemon with startproc(8). If this fails
        ## the return value is set appropriately by startproc.
        /sbin/startproc -p $PIDFILE $DAEMON "$OPTS"

        # Remember status and be verbose
        rc_status -v
        ;;
    stop)
        echo -n "Stopping iSCSI target service: "
        ## Stop daemon with killproc(8) and if this fails
        ## killproc sets the return value according to LSB.
        ietadm --op delete >/dev/null 2>/dev/null
        /sbin/killproc -p $PIDFILE -TERM $DAEMON
        modprobe -r iscsi_trgt 2>/dev/null
        RETVAL=$?
        modprobe -r crc32c 2>/dev/null
        if [ $RETVAL != "0" ]; then
                rc_failed
        fi

        # Remember status and be verbose
        rc_status -v
        ;;
    restart|reload)
        ## Stop the service and regardless of whether it was
        ## running or not, start it again.
        $0 stop
        $0 start

        # Remember status and be quiet
        rc_status
        ;;
    status)
        echo -n "Checking for iSCSI target service"
        ## Check status with checkproc(8), if process is running
        ## checkproc will return with exit status 0.
        /sbin/checkproc -p $PIDFILE $DAEMON

        # Remember status and be verbose
        rc_status -v
        ;;
    *)
        echo $"Usage: $0 {start|stop|restart|status}"
        exit 1
esac
rc_exit
++++++ iscsitarget.sysconfig ++++++
## Path:        System/Daemons
## Description: Options for iscsitarget (ietd) daemon
## Type:        string
## Default:     ""
## Config:      iscsitarget
#
# -c filename, --config=filename
#       Specify configuration file, default is /etc/ietd.conf
#
# -d debuglevel, --debug=debuglevel
#       Turns on debugging. Logging goes to /var/log/syslog via syslog(1).
#
# -f, --foreground
#       Act as a normal application which uses a console.
#
# -g GID, --gid=GID
#       Specify running group id, default is current gid.
#
# -a address, --address=address
#       Specify on which local address the server should listen, default is any.
#
# -p port, --port=port
#       Specify on which port the server should listen, default is 3260.
#
# -h, --help
#       Display help message on command line options.
#
# -s IP, --isns=IP
#       isns server's IP address
#
# -u UID, --uid=UID
#       Specify running user id, default is current uid.
#
IETD_OPTS=""
++++++ preamble ++++++
Enhances: kernel-%1
Recommends: iscsitarget
++++++ services ++++++
## Name: iscsitarget Server
## Description: Opens ports for iscsitarget

# space separated list of allowed TCP ports
TCP="iscsi-target"

Reply via email to