diff --git a/nbd-2.9.5-doc.diff b/nbd-2.9.5-doc.diff index 7eb7061..ec714fc 100644 --- a/nbd-2.9.5-doc.diff +++ b/nbd-2.9.5-doc.diff @@ -1,7 +1,9 @@ -diff -uNrp nbd-2.9.5.nowarn/README nbd-2.9.5.doc/README ---- nbd-2.9.5.nowarn/README 2007-01-30 14:00:59.000000000 +0100 -+++ nbd-2.9.5.doc/README 2007-07-30 17:08:31.328692000 +0200 -@@ -12,14 +12,16 @@ deadlock issues if you do that[1]. +Index: nbd-2.9.8/README +=================================================================== +--- nbd-2.9.8.orig/README ++++ nbd-2.9.8/README +@@ -11,16 +11,18 @@ deadlock issues if you do that[1]. + To install the package, please see the INSTALL file. You'll need to install it on both the client and the server. @@ -21,9 +23,11 @@ diff -uNrp nbd-2.9.5.nowarn/README nbd-2.9.5.doc/README +(if you need more than one NBD device, repeat the above command for nbd1, +nbd2, ...) - Next, start the server. You can use a file or a block device for that: + Since there's a problem with nbd and the (default) cfq I/O scheduler, + you may want to set it to deadline: -@@ -39,7 +41,7 @@ nbd-client e.g., @@ -32,3 +36,4 @@ diff -uNrp nbd-2.9.5.nowarn/README nbd-2.9.5.doc/README nbd-client must be ran as root; the same is not true for nbd-server (but do make sure that /var/run is writeable by the server that nbd-server + runs as; otherwise, you won't get a PID file, though the server will diff --git a/nbd-2.9.5-warn.diff b/nbd-2.9.5-warn.diff index 90a5630..271f160 100644 --- a/nbd-2.9.5-warn.diff +++ b/nbd-2.9.5-warn.diff @@ -1,34 +1,9 @@ -diff -uNrp nbd-2.9.5/nbd-server.c nbd-2.9.5.nowarn/nbd-server.c ---- nbd-2.9.5/nbd-server.c 2007-07-30 16:48:09.400856000 +0200 -+++ nbd-2.9.5.nowarn/nbd-server.c 2007-07-30 17:00:30.179327000 +0200 -@@ -395,7 +395,7 @@ SERVER* cmdline(int argc, char *argv[]) - size_t last; - char suffix; - gboolean do_output=FALSE; -- gchar* section_header; -+ gchar* section_header=NULL; - - if(argc==1) { - return NULL; -@@ -865,7 +865,7 @@ ssize_t rawexpwrite(off_t a, char *buf, - * @return 0 on success, nonzero on failure +Index: nbd-2.9.8/nbd-server.c +=================================================================== +--- nbd-2.9.8.orig/nbd-server.c ++++ nbd-2.9.8/nbd-server.c +@@ -1334,9 +1334,9 @@ void serveconnection(CLIENT *client) { **/ - int rawexpwrite_fully(off_t a, char *buf, size_t len, CLIENT *client) { -- ssize_t ret; -+ ssize_t ret = 0; - - while(len > 0 && (ret=rawexpwrite(a, buf, len, client)) > 0 ) { - a += ret; -@@ -907,7 +907,7 @@ ssize_t rawexpread(off_t a, char *buf, s - * @return 0 on success, nonzero on failure - **/ - int rawexpread_fully(off_t a, char *buf, size_t len, CLIENT *client) { -- ssize_t ret; -+ ssize_t ret = 0; - - while(len > 0 && (ret=rawexpread(a, buf, len, client)) > 0 ) { - a += ret; -@@ -1266,7 +1266,7 @@ void serveconnection(CLIENT *client) { void set_peername(int net, CLIENT *client) { struct sockaddr_in addrin; struct sockaddr_in netaddr; @@ -37,12 +12,4 @@ diff -uNrp nbd-2.9.5/nbd-server.c nbd-2.9.5.nowarn/nbd-server.c char *peername; char *netname; char *tmp; -@@ -1486,7 +1486,7 @@ int serveloop(GArray* servers) { - } - /* child */ - g_hash_table_destroy(children); -- for(i=0;ilen,serve=(g_array_index(servers, SERVER*, i));i++) { -+ for(i=0; (ilen && (serve=(g_array_index(servers, SERVER*, i)))); i++) { - close(serve->socket); - } - /* FALSE does not free the + int i; diff --git a/nbd-2.9.5.tar.bz2 b/nbd-2.9.5.tar.bz2 deleted file mode 100644 index 83314f5..0000000 --- a/nbd-2.9.5.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:60a951191f5d3a74d974d681bd75a701a16056e2206e7d53546be5b5e89241ff -size 179919 diff --git a/nbd-2.9.8.tar.bz2 b/nbd-2.9.8.tar.bz2 new file mode 100644 index 0000000..6ac511d --- /dev/null +++ b/nbd-2.9.8.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:926d8ff69eed223d63e16f14da5cf896464697757bba8e2cccdd59e8965b589f +size 182724 diff --git a/nbd-server-daemonize-0.diff b/nbd-server-daemonize-0.diff deleted file mode 100644 index 3b036cc..0000000 --- a/nbd-server-daemonize-0.diff +++ /dev/null @@ -1,27 +0,0 @@ -diff -uNrp nbd-2.9.5.orig/nbd-server.c nbd-2.9.5/nbd-server.c ---- nbd-2.9.5.orig/nbd-server.c 2007-07-08 11:58:44.000000000 +0200 -+++ nbd-2.9.5/nbd-server.c 2007-07-30 16:48:09.400856000 +0200 -@@ -1323,17 +1323,17 @@ void destroy_pid_t(gpointer data) { - void daemonize(SERVER* serve) { - FILE*pidf; - -- if(!(serve->port)) { -- return; -- } -- if(daemon(0,0)<0) { -+ //if (!serve) { -+ // return; -+ //} -+ if(daemon(0,0) < 0) { - err("daemon"); - } - if(!*pidftemplate) { - if(serve) { -- strncpy(pidftemplate, "/var/run/server.%d.pid", 255); -+ strncpy(pidftemplate, "/var/run/nbd-server.%d.pid", 255); - } else { -- strncpy(pidftemplate, "/var/run/server.pid", 255); -+ strncpy(pidftemplate, "/var/run/nbd-server.pid", 255); - } - } - snprintf(pidfname, 255, pidftemplate, serve ? serve->port : 0); diff --git a/nbd.changes b/nbd.changes index 223a1d1..708e5bf 100644 --- a/nbd.changes +++ b/nbd.changes @@ -1,3 +1,15 @@ +------------------------------------------------------------------- +Wed Nov 7 22:12:26 CET 2007 - garloff@suse.de + +- Split nbd into nbd and nbd-doc packages. +- Update to 2.9.8: + * nbd-server can now setuid to specified user and group + * prerun and postrun scripts can be specified + * IP address to bind to (listenaddress) can be configured + * Socket Direct Protocol (sdp) -- not enabled + * server exits now after connection has gone (oops!) + * nbd-client: timeout parameter + ------------------------------------------------------------------- Mon Jul 30 15:51:16 CEST 2007 - garloff@suse.de diff --git a/nbd.spec b/nbd.spec index e33c7c3..74a0643 100644 --- a/nbd.spec +++ b/nbd.spec @@ -1,5 +1,5 @@ # -# spec file for package nbd (Version 2.9.5) +# spec file for package nbd (Version 2.9.8) # # Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany. # This file and all modifications and additions to the pristine @@ -12,21 +12,21 @@ Name: nbd BuildRequires: doxygen glib2-devel -PreReq: %insserv_prereq -Version: 2.9.5 +PreReq: %insserv_prereq coreutils +Version: 2.9.8 Release: 1 License: GPL v2 or later Group: Productivity/Networking/Other -Autoreqprov: on +AutoReqProv: on Source: %{name}-%{version}.tar.bz2 Source2: init.nbd-server -Patch1: nbd-server-daemonize-0.diff Patch2: nbd-2.9.5-warn.diff Patch3: nbd-2.9.5-doc.diff Summary: Network Block Device Server and Client Utilities -URL: http://nbd.sourceforge.net/ +Url: http://nbd.sourceforge.net/ Prefix: /usr BuildRoot: %{_tmppath}/%{name}-%{version}-build +Suggests: nbd-doc %description This package contains nbd-server. It is the server backend for the nbd @@ -48,6 +48,35 @@ configure the nbd devices on the client side. +Authors: +-------- + Wouter Verhelst + Anton Altaparmakov + Pavel Machek + Paul Clements + +%package doc +Summary: Network Block Device Server and Client Utilities +Group: Productivity/Networking/Other +Requires: nbd = %{version} + +%description doc +This package contains the HTML documentation for the network block +device (nbd) utilities. + +nbd can be used to have a filesystem stored on another machine. It does +provide a block device, not a file system; so unless you put a +clustering filesystem on top of it, you can't access it simultaneously +from more than one client. Use NFS or a real cluster FS (such as +ocfs2) if you want to do this. nbd-server can export a file (which may +contain a filesystem image) or a partition. Swapping over nbd is +possible as well, though it's said not to be safe against OOM and +should not be used for that case. nbd-server also has a copy-on-write +mode where changes are saved to a separate file and thrown away when +the connection closes. + + + Authors: -------- Wouter Verhelst @@ -57,7 +86,6 @@ Authors: %prep %setup -%patch1 -p1 %patch2 -p1 %patch3 -p1 touch nbd-client.8 @@ -93,13 +121,16 @@ grep -A16 -B1 '^\[generic\]' README > $RPM_BUILD_ROOT/etc/nbd-server/config.exam %{_mandir}/man1/nbd-server.1.gz %{_mandir}/man8/nbd-client.8.gz %doc README -%doc doc/html #%config(noreplace) /etc/nbd-server.conf %dir /etc/nbd-server %ghost %config(noreplace) /etc/nbd-server/config %ghost %config(noreplace) /etc/nbd-server/allow /etc/nbd-server/config.example +%files doc +%defattr(-,root,root) +%doc doc/html + %post %{fillup_and_insserv -f nbd-server} if test -e /etc/nbd-server.conf; then @@ -124,7 +155,18 @@ fi %postun %{insserv_cleanup} +%preun +%{stop_on_removal nbd-server} %changelog +* Wed Nov 07 2007 - garloff@suse.de +- Split nbd into nbd and nbd-doc packages. +- Update to 2.9.8: + * nbd-server can now setuid to specified user and group + * prerun and postrun scripts can be specified + * IP address to bind to (listenaddress) can be configured + * Socket Direct Protocol (sdp) -- not enabled + * server exits now after connection has gone (oops!) + * nbd-client: timeout parameter * Mon Jul 30 2007 - garloff@suse.de - Convert options from old nbd-server.conf to new nbd-server/config on update and drop support for old config file syntax.