[Pkg-ofed-commits] [srptools] 01/01: Disallow all targets if not explicitly allowed

Roland Fehrenbacher rfehren-guest at moszumanska.debian.org
Thu May 4 16:05:23 UTC 2017


This is an automated email from the git hooks/post-receive script.

rfehren-guest pushed a commit to branch master
in repository srptools.

commit ed50cbf94d5f86d3a6b93ce02c919d8c49ad0054
Author: Roland Fehrenbacher <rf at q-leap.de>
Date:   Thu May 4 12:25:03 2017 +0000

    Disallow all targets if not explicitly allowed
---
 debian/NEWS                                        | 12 +++++
 debian/changelog                                   | 11 ++++
 debian/control                                     |  5 +-
 ...low-all-targets-if-not-explicitly-allowed.patch | 26 ++++++++++
 debian/patches/series                              |  1 +
 debian/srptools.postinst                           | 59 ++++++++++++++++++++++
 debian/srptools.preinst                            | 49 ++++++++++++++++++
 7 files changed, 161 insertions(+), 2 deletions(-)

diff --git a/debian/NEWS b/debian/NEWS
new file mode 100644
index 0000000..ed076d1
--- /dev/null
+++ b/debian/NEWS
@@ -0,0 +1,12 @@
+srptools (1.0.3-2) unstable; urgency=medium
+
+  Please note, that the default config in /etc/srp_daemon.conf has changed,
+  such that now no targets are activated at boot. The previous default was to
+  activate all targets. In order not to silently change the behaviour on
+  old installations, this change is not made when upgrading the package,
+  but only for new installations. If you want to modify your installation
+  to use the new default behaviour, you can manually uncomment the 'd' on
+  the last line of the config. Targets that you want to use on a server
+  must now explicitly be specified with an 'a <target def>' line in the config. 
+
+ -- Roland Fehrenbacher <rf at q-leap.de>  Thu, 04 May 2017 13:43:50 +0000
diff --git a/debian/changelog b/debian/changelog
index e7a8161..3712603 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,14 @@
+srptools (1.0.3-2) unstable; urgency=medium
+
+  * Don't activate any targets per default. (Closes: #740945)
+    This is more sensible than the previous default of bringing up all targets
+    in the IB fabric upon boot. In a larger fabric with many storage targets
+    available, most of the times only one or a few targets are wanted on a
+    particular machine.
+  * Update to Standards-Version 3.9.8, no changes required.
+
+ -- Roland Fehrenbacher <rf at q-leap.de>  Thu, 04 May 2017 13:43:50 +0000
+
 srptools (1.0.3-1) unstable; urgency=medium
 
   * New upstream release.
diff --git a/debian/control b/debian/control
index 3ed4cf4..4825224 100644
--- a/debian/control
+++ b/debian/control
@@ -2,9 +2,10 @@ Source: srptools
 Section: net
 Priority: extra
 Maintainer: OFED and Debian Developement and Discussion <pkg-ofed-devel at lists.alioth.debian.org>
-Uploaders: Ana Beatriz Guerrero Lopez <ana at debian.org>
+Uploaders: Ana Beatriz Guerrero Lopez <ana at debian.org>,
+           Roland Fehrenbacher <rf at q-leap.de>
 Build-Depends: debhelper (>= 9), autotools-dev, libibumad-dev, libibverbs-dev
-Standards-Version: 3.9.7
+Standards-Version: 3.9.8
 Vcs-Git: git://anonscm.debian.org/pkg-ofed/srptools.git
 Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-ofed/srptools.git
 Homepage: https://www.openfabrics.org/downloads/srptools/
diff --git a/debian/patches/0001-Disallow-all-targets-if-not-explicitly-allowed.patch b/debian/patches/0001-Disallow-all-targets-if-not-explicitly-allowed.patch
new file mode 100644
index 0000000..d28a9f0
--- /dev/null
+++ b/debian/patches/0001-Disallow-all-targets-if-not-explicitly-allowed.patch
@@ -0,0 +1,26 @@
+From: Roland Fehrenbacher <rf at q-leap.de>
+Date: Thu, 4 May 2017 14:42:22 +0000
+Subject: Disallow all targets if not explicitly allowed
+
+---
+ srp_daemon/srp_daemon.conf | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/srp_daemon/srp_daemon.conf b/srp_daemon/srp_daemon.conf
+index 8a3abe5..60aed4a 100644
+--- a/srp_daemon/srp_daemon.conf
++++ b/srp_daemon/srp_daemon.conf
+@@ -9,11 +9,11 @@
+ #a       pkey=ffff
+ ## allow target with the following id_ext and ioc_guid
+ #a       id_ext=200500A0B81146A1,ioc_guid=00a0b80200402bef
+-## disallow all the rest
+-#d
+ ##
+ ## Here is another example:
+ ##
+ ## Allow all targets and set queue size to 128.
+ # a      queue_size=128,max_cmd_per_lun=128
+ 
++# Disallow all targets if not explicitly allowed
++d
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..287e627
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+0001-Disallow-all-targets-if-not-explicitly-allowed.patch
diff --git a/debian/srptools.postinst b/debian/srptools.postinst
new file mode 100644
index 0000000..04ed77a
--- /dev/null
+++ b/debian/srptools.postinst
@@ -0,0 +1,59 @@
+#!/bin/sh
+# postinst script for slurmctld
+#
+# see: dh_installdeb(1)
+
+set -e
+
+preversion=$2
+
+# summary of how this script can be called:
+#        * <postinst> `configure' <most-recently-configured-version>
+#        * <old-postinst> `abort-upgrade' <new version>
+#        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
+#          <new-version>
+#        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
+#          <failed-install-package> <version> `removing'
+#          <conflicting-package> <version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+#
+STARTOPTION="start"
+case "$1" in
+  configure)
+    if [ -n "$preversion" ]; then
+      if dpkg --compare-versions "$preversion" lt "1.0.3-2"; then
+        conffile=/etc/srp_daemon.conf
+        checkfile=/tmp/srptools-old-had-d
+        # Restore previous default config, if it was unmodified
+        md5sum="$(md5sum $conffile | sed -e 's/ .*//')"
+        old_md5sum="$(dpkg-query -W -f='${Conffiles}' srptools | \
+            sed -n -e "\' $conffile ' { s/.* //; p }")"
+        if [ "$md5sum" = "$old_md5sum" ]; then
+          checkfile=/tmp/srptools-old-had-d
+          if [ ! -e $checkfile ]; then
+            # Uncomment again only if original version didn't already have the
+            # 'd' line.
+            sed -i -e 's/^d$/#d/g' $conffile
+          fi
+        fi
+        if [ -e $checkfile ]; then
+          rm -f $checkfile
+        fi
+      fi
+    fi
+    ;;
+    abort-upgrade|abort-remove|abort-deconfigure)
+    ;;
+    *)
+        echo "postinst called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/srptools.preinst b/debian/srptools.preinst
new file mode 100644
index 0000000..6d84a47
--- /dev/null
+++ b/debian/srptools.preinst
@@ -0,0 +1,49 @@
+#!/bin/sh
+# postinst script for slurmctld
+#
+# see: dh_installdeb(1)
+
+set -e
+
+preversion=$2
+
+# summary of how this script can be called:
+#        * <postinst> `configure' <most-recently-configured-version>
+#        * <old-postinst> `abort-upgrade' <new version>
+#        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
+#          <new-version>
+#        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
+#          <failed-install-package> <version> `removing'
+#          <conflicting-package> <version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+#
+STARTOPTION="start"
+case "$1" in
+  upgrade)
+    if [ -n "$preversion" ]; then
+      if dpkg --compare-versions "$preversion" lt "1.0.3-2"; then
+        conffile=/etc/srp_daemon.conf
+        checkfile=/tmp/srptools-old-had-d
+        # Check whether old config already contains the new 'global' 'd'
+        # and set temporary file 
+        if grep -q '^\s*d\s*\#*' $conffile ; then
+          touch $checkfile
+        fi
+      fi
+    fi
+    ;;
+    abort-upgrade|abort-remove|abort-deconfigure)
+    ;;
+    *)
+        echo "postinst called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ofed/srptools.git



More information about the Pkg-ofed-commits mailing list