diff --git a/init.nbd-server b/init.nbd-server index 8051636..78ec8cc 100644 --- a/init.nbd-server +++ b/init.nbd-server @@ -29,7 +29,12 @@ test -x $NBD_BIN || { echo "$NBD_BIN not installed"; # Check for existence of needed config file and read it NBD_CONFIG=/etc/nbd-server.conf -test -r $NBD_CONFIG || { echo "$NBD_CONFIG not existing"; +NBD29_CONFIG=/etc/nbd-server/config +test -r $NBD_CONFIG && { + echo "$NBD_CONFIG: Using old style config file deprecated"; +} +test -r $NBD_CONFIG || test -r $NBD29_CONFIG || { + echo "No config file $NBD29_CONFIG existing"; if [ "$1" = "stop" ]; then exit 0; else exit 6; fi; } @@ -44,9 +49,13 @@ case "$1" in echo -n "Starting nbd-server " ## Start daemon with startproc(8). If this fails ## the return value is set appropriately by startproc. - declare -i started - started=0 - while read port file options; do + if test -r $NBD29_CONFIG; then + $NBD_BIN + rc_check + else + declare -i started + started=0 + while read port file options; do if test -z "$port"; then continue; fi if test "${port:0:1}" = "#"; then continue; fi echo -n " $port" @@ -54,7 +63,8 @@ case "$1" in $NBD_BIN $port $file $options rc_check let started+=1 - done < $NBD_CONFIG + done < $NBD_CONFIG + fi # Remember status and be verbose if test $_rc_status = 0 -a $started = 0; then rc_status -s @@ -67,14 +77,16 @@ case "$1" in echo -n "Shutting down nbd-server " ## Stop daemon with killproc(8) and if this fails ## killproc sets the return value according to LSB. - - while read port file options; do + if test -r $NBD29_CONFIG; then + killall ${NBD_BIN##*/} + else + while read port file options; do if test -z "$port"; then continue; fi if test "${port:0:1}" = "#"; then continue; fi echo -n " $port" /sbin/killproc -p /var/run/nbd-server.$port.pid $NBD_BIN $port $file $options - done < $NBD_CONFIG - + done < $NBD_CONFIG + fi # Remember status and be verbose rc_status -v ;; diff --git a/nbd-2.8.7.tar.bz2 b/nbd-2.8.7.tar.bz2 deleted file mode 100644 index c74e10d..0000000 --- a/nbd-2.8.7.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a69d1690ad587d81b85c34d1ef9bf47abf0ba21dc96876d95dd6a9a193a859f1 -size 141225 diff --git a/nbd-2.9.2.tar.bz2 b/nbd-2.9.2.tar.bz2 new file mode 100644 index 0000000..7687272 --- /dev/null +++ b/nbd-2.9.2.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9a2d8c70da201ad4934d6f104e13dd49c4901e84a94b6d9858d1df992f082855 +size 178100 diff --git a/nbd-doc.diff b/nbd-doc.diff deleted file mode 100644 index c157a6f..0000000 --- a/nbd-doc.diff +++ /dev/null @@ -1,63 +0,0 @@ -diff -uNrp nbd-2.8.1.orig/nbd-client.8 nbd-2.8.1/nbd-client.8 ---- nbd-2.8.1.orig/nbd-client.8 2005-10-27 19:53:13.000000000 +0200 -+++ nbd-2.8.1/nbd-client.8 2005-10-28 10:05:12.523377343 +0200 -@@ -65,24 +65,24 @@ Some examples of nbd-client usage: - \(bu - To connect to a server running on port 2000 at host - "server.domain.com", using the client's block special file --"/dev/nd0": -+"/dev/nbd0": - - \fBnbd-client server.domain.com 2000 --/dev/nd0\fR -+/dev/nbd0\fR - .TP 0.2i - \(bu - To connect to a server running on port 2001 at host - "swapserver.domain.com", using the client's block special --file "/dev/nd1", for swap purposes: -+file "/dev/nbd1", for swap purposes: - --\fBnbd-client swapserver.domain.com 2001 /dev/nd1 -+\fBnbd-client swapserver.domain.com 2001 /dev/nbd1 - -swap\fR - .TP 0.2i - \(bu - To disconnect the above connection again (after making - sure the block special file is not in use anymore): - --\fBnbd-client -d /dev/nd1\fR -+\fBnbd-client -d /dev/nbd1\fR - .SH "SEE ALSO" - .PP - nbd-server (1). -diff -uNrp nbd-2.8.1.orig/nbd-client.8.sgml nbd-2.8.1/nbd-client.8.sgml ---- nbd-2.8.1.orig/nbd-client.8.sgml 2005-10-27 19:39:06.000000000 +0200 -+++ nbd-2.8.1/nbd-client.8.sgml 2005-10-28 10:05:35.266410510 +0200 -@@ -141,21 +141,21 @@ manpage.1: manpage.sgml - - To connect to a server running on port 2000 at host - "server.domain.com", using the client's block special file -- "/dev/nd0": -+ "/dev/nbd0": - nbd-client server.domain.com 2000 -- /dev/nd0 -+ /dev/nbd0 - - - To connect to a server running on port 2001 at host - "swapserver.domain.com", using the client's block special -- file "/dev/nd1", for swap purposes: -- nbd-client swapserver.domain.com 2001 /dev/nd1 -+ file "/dev/nbd1", for swap purposes: -+ nbd-client swapserver.domain.com 2001 /dev/nbd1 - -swap - - - To disconnect the above connection again (after making - sure the block special file is not in use anymore): -- nbd-client -d /dev/nd1 -+ nbd-client -d /dev/nbd1 - - - diff --git a/nbd-types.diff b/nbd-types.diff deleted file mode 100644 index 5dd9431..0000000 --- a/nbd-types.diff +++ /dev/null @@ -1,56 +0,0 @@ -Index: cliserv.h -=================================================================== ---- cliserv.h.orig -+++ cliserv.h -@@ -34,16 +34,19 @@ typedef unsigned long long u64; - #else - #error I need at least some 64-bit type - #endif - -+#ifndef NBD_H_LINUX - /* 2.6.18 and above use __be* rather than u* */ - #define __be32 u32 - #define __be64 u64 -+#endif - - #ifdef NBD_H_LOCAL - #include "nbd.h" - #else - #ifdef NBD_H_LINUX -+#include - #include - #endif // NBD_H_LINUX - #endif // NBD_H_LOCAL - -Index: configure.ac -=================================================================== ---- configure.ac.orig -+++ configure.ac -@@ -74,21 +74,19 @@ AC_MSG_CHECKING(where to find a working - dnl We need to check for NBD_CMD_DISC, but that's part of an enum, it is not - dnl #define'd. Therefore, we check for something which is differently #define'd - dnl in the old or new versions, even if we don't really care about that. - dnl This might break at some time, but it should work for now, so... --AC_TRY_COMPILE([#define u32 int --#define u64 int --#define __be32 int --#define __be64 int -+AC_TRY_COMPILE([#define u32 __u32 -+#define u64 __u64 -+#include - #include "nbd.h" - ], - [int foo=NBD_CMD_DISC], - [AC_DEFINE(NBD_H_LOCAL, 1, Set to 1 if a (kernel 2.6) nbd.h can be found in the current directory) - NBD_H='"nbd.h"'], -- AC_TRY_COMPILE([#define u32 int --#define u64 int --#define __be32 int --#define __be64 int -+ AC_TRY_COMPILE([#define u32 __u32 -+#define u64 __u64 -+#include - #include - ], - [int foo=NBD_CMD_DISC], - [AC_DEFINE(NBD_H_LINUX, 1, Set to 1 if a (kernel 2.6) nbd.h can be found in the linux directory in the search path) NBD_H=''], diff --git a/nbd.changes b/nbd.changes index aaa33ef..3c0e50a 100644 --- a/nbd.changes +++ b/nbd.changes @@ -1,3 +1,26 @@ +------------------------------------------------------------------- +Mon Mar 12 23:45:45 CET 2007 - garloff@suse.de + +- Update to 2.9.2: + * make child socket nonblocking + * Reintegrate fix for 64bit on looking for file size. + * Fix cross-compiling + * Search for libraries to allow linking on Solaris +- Update to 2.9.1: + * A fix for a piece of code following a null pointer, and one + for a memory leak (if only minor). +- Update to 2.9.0: + * * Configuration file support + * The ability to server multiple nbd-server exports from one server + * Better multiple-file support (files can now be of any random size) + * Better support for virtualizing servers (in addition to replacing + %s with the client's IP address, it is now also possible to use + other options which allow for hashed directories) + * Support for changing uid and gid after startup + * The ability to do the copy-on-write stuff with a sparse file rather + than a mapped file (specified by a config file option), which may be + slightly faster. + ------------------------------------------------------------------- Sat Nov 18 01:49:07 CET 2006 - garloff@suse.de diff --git a/nbd.spec b/nbd.spec index 8f58685..bf58cef 100644 --- a/nbd.spec +++ b/nbd.spec @@ -1,7 +1,7 @@ # -# spec file for package nbd (Version 2.8.7) +# spec file for package nbd (Version 2.9.2) # -# Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany. # This file and all modifications and additions to the pristine # package are under the same license as the package itself. # @@ -13,15 +13,13 @@ Name: nbd BuildRequires: doxygen glib2-devel PreReq: %insserv_prereq -Version: 2.8.7 -Release: 12 +Version: 2.9.2 +Release: 1 License: GNU General Public License (GPL) Group: Productivity/Networking/Other Autoreqprov: on Source: %{name}-%{version}.tar.bz2 Source2: init.nbd-server -Patch1: nbd-doc.diff -Patch2: nbd-types.diff Summary: Network Block Device Server and Client Utilities URL: http://nbd.sourceforge.net/ Prefix: /usr @@ -56,8 +54,6 @@ Authors: %prep %setup -%patch1 -p1 -%patch2 touch nbd-client.8 %build @@ -96,7 +92,27 @@ echo "#Port file options" > $RPM_BUILD_ROOT/etc/nbd-server.conf %postun %{insserv_cleanup} -%changelog -n nbd +%changelog +* Mon Mar 12 2007 - garloff@suse.de +- Update to 2.9.2: + * make child socket nonblocking + * Reintegrate fix for 64bit on looking for file size. + * Fix cross-compiling + * Search for libraries to allow linking on Solaris +- Update to 2.9.1: + * A fix for a piece of code following a null pointer, and one + for a memory leak (if only minor). +- Update to 2.9.0: + * * Configuration file support + * The ability to server multiple nbd-server exports from one server + * Better multiple-file support (files can now be of any random size) + * Better support for virtualizing servers (in addition to replacing + %%s with the client's IP address, it is now also possible to use + other options which allow for hashed directories) + * Support for changing uid and gid after startup + * The ability to do the copy-on-write stuff with a sparse file rather + than a mapped file (specified by a config file option), which may be + slightly faster. * Sat Nov 18 2006 - garloff@suse.de - Add nbd-server init script (parses /etc/nbd-server.conf). * Thu Oct 19 2006 - garloff@suse.de