- Update to version 3.15.2:

OBS-URL: https://build.opensuse.org/package/show/network:utilities/nbd?expand=0&rev=43
This commit is contained in:
Martin Pluskal
2017-03-24 12:46:40 +00:00
committed by Git OBS Bridge
parent 17a891a7de
commit 6f1fb6ecc0
7 changed files with 97 additions and 287 deletions

View File

@@ -1,149 +0,0 @@
#!/bin/sh
# /etc/init.d/nbd-server
# and its symbolic link
# /usr)sbin/rcnbd-server
#
# Template system startup script for some example service/daemon FOO
#
# LSB compatible service control script; see http://www.linuxbase.org/spec/
#
### BEGIN INIT INFO
# Provides: nbd-server
# Required-Start: $syslog $remote_fs
# Should-Start: $time ypbind sendmail
# Required-Stop: $syslog $remote_fs
# Should-Stop: $time ypbind sendmail
# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Short-Description: nbd server
# Description: Start nbd server
### END INIT INFO
#
# Check for missing binaries (stale symlinks should not happen)
# Note: Special treatment of stop for LSB conformance
NBD_BIN=/usr/bin/nbd-server
test -x $NBD_BIN || { echo "$NBD_BIN not installed";
if [ "$1" = "stop" ]; then exit 0;
else exit 5; fi; }
# Check for existence of needed config file and read it
NBD_CONFIG=/etc/nbd-server.conf
NBD29_CONFIG=/etc/nbd-server/config
test -r $NBD_CONFIG && {
echo "$NBD_CONFIG: Using old style config file unsupported";
}
test -r $NBD29_CONFIG || {
echo "No config file $NBD29_CONFIG existing";
if [ "$1" = "stop" ]; then
exit 0;
else
exit 6;
fi;
}
# Shell functions sourced from /etc/rc.status:
. /etc/rc.status
# Reset status of this service
rc_reset
case "$1" in
start)
echo -n "Starting nbd-server "
## Start daemon with startproc(8). If this fails
## the return value is set appropriately by startproc.
startproc $NBD_BIN
rc_status -v
;;
stop)
echo -n "Shutting down nbd-server "
## Stop daemon with killproc(8) and if this fails
## killproc sets the return value according to LSB.
#killall ${NBD_BIN##*/}
$0 status >/dev/null 2>&1
stat=$?
if test $stat = 3; then echo -n " (not running) ";
elif test $stat != 0; then echo -n " (dead) "; fi
killproc $NBD_BIN
# TODO: Only kill nbd-server processes started by config file.
# Remember status and be verbose
rc_status -v
;;
try-restart|condrestart)
## Do a restart only if the service was active before.
## Note: try-restart is now part of LSB (as of 1.9).
## RH has a similar command named condrestart.
if test "$1" = "condrestart"; then
echo "${attn} Use try-restart ${done}(LSB)${attn} rather than condrestart ${warn}(RH)${norm}"
fi
$0 status >/dev/null 2>&1
if test $? = 0; then
$0 restart
else
rc_reset # Not running is not a failure.
fi
# Remember status and be quiet
rc_status
;;
restart)
## 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
;;
force-reload)
## Signal the daemon to reload its config. Most daemons
## do this on signal 1 (SIGHUP).
## If it does not support it, restart the service if it
## is running.
echo -n "Reload service nbd-server "
## if it supports it:
#/sbin/killproc -HUP $NBD_BIN
#touch /var/run/nbd-server.pid
#rc_status -v
## Otherwise:
$0 try-restart
rc_status
;;
reload)
## Like force-reload, but if daemon does not support
## signaling, do nothing (!)
#$0 force-reload
#rc_status
## Otherwise if it does not support reload:
echo -n "Reload service nbd-server "
rc_failed 3
rc_status -v
;;
status)
echo -n "Checking for service nbd-server "
## Check status with checkproc(8), if process is running
## checkproc will return with exit status 0.
checkproc $NBD_BIN
# NOTE: rc_status knows that we called this init script with
# "status" option and adapts its messages accordingly.
rc_status -v
;;
probe)
## Optional: Probe for the necessity of a reload, print out the
## argument to this init script which is required for a reload.
## Note: probe is not (yet) part of LSB (as of 1.9)
test $NBD29_CONFIG -nt /var/run/nbd-server.pid && echo restart
#rc_failed 3
;;
*)
echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload|probe}"
exit 1
;;
esac
rc_exit

View File

@@ -1,12 +0,0 @@
Index: nbd-3.13/nbd-client.c
===================================================================
--- nbd-3.13.orig/nbd-client.c
+++ nbd-3.13/nbd-client.c
@@ -81,6 +81,7 @@ int check_conn(char* devname, int do_pri
}
buf[(len < 256) ? len : 255]='\0';
if(do_print) printf("%s\n", buf);
+ close(fd);
return 0;
}

View File

@@ -1,22 +0,0 @@
Index: nbd-3.13/doc/Doxyfile.in
===================================================================
--- nbd-3.13.orig/doc/Doxyfile.in
+++ nbd-3.13/doc/Doxyfile.in
@@ -30,7 +30,7 @@ PROJECT_NUMBER = @PACKAGE_VERSIO
# If a relative path is entered, it will be relative to the location
# where doxygen was started. If left blank the current directory will be used.
-OUTPUT_DIRECTORY = doxygen-output
+OUTPUT_DIRECTORY = doc
# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
# 4096 sub-directories (in 2 levels) under the output directory of each output
@@ -459,7 +459,7 @@ WARN_LOGFILE =
# directories like "/usr/src/myproject". Separate the files or directories
# with spaces.
-INPUT = ..
+INPUT =
# If the value of the INPUT tag contains directories, you can use the
# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:8597cd97a41930dfcbcc6ce7cf910f6b609771718a4f1680713c2f2ba5cc200d
size 459756

3
nbd-3.15.2.tar.xz Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:cf188ebdad3d317742b874fb8669faa437ee9fab4005e71b049bc301011af344
size 506016

View File

@@ -1,3 +1,61 @@
-------------------------------------------------------------------
Fri Mar 24 12:16:55 UTC 2017 - mpluskal@suse.com
- Update to version 3.15.2:
* Fix the copyonwrite situation with multiple threads. This has
been broken since nbd 3.12, where multiple outstanding writes
could corrupt the copyonwrite diff file.
* Build system improvements so that things work again if
nbd-client isn't buildable while GnuTLS is enabled
* Documentation updates
* Fixes to the GnuTLS usage, and the ability to configure the
priority string for that library
- Changes for version 3.15.1:
* minor but crucial fix in the handling of the WRITE_ZEROES
command, which would otherwise not work in cooperation with
TLS.
- Changes for version 3.15.0:
* Implement NBD_CMD_WRITE_ZEROES, for efficiently writing large
numbers of zeroes (server side implementation only)
* (optional) support for NBD_OPT_STARTTLS, using GnuTLS.
* Support for multiplexing commands over multiple connections,
for improving performance (requires Linux 4.10 or above).
* Support for using splice(), also for improving performance
* Protocol errors during negotiation now are accompanied by a
human-readable error string.
* Fix the handling of maxconnections, so that it is not a global
setting (over all exports) but rather a per-export setting.
* Fix handling of unknown options sent to the server. Previously
we would desync from the protocol, causing another error and a
disconnect.
* Produce a log message when the address family of the client
socket does not match the expected address family in the
authfile handling. A proper fix would convert IPv4 sockets to
v6-mapped v4 sockets, but that's much more complicated.
* and various other minor fixes too small to mention here; see
the changelog
- Changes for version 3.14.0:
* Major review of doc/proto.md, with many clarifications.
* Some bug fixes for nbd-server that were discovered during the
extensive updates to proto.md
* Some fixes for non-Linux platforms,
* Some minor incremental improvements to the new nbdtab
functionality,
* Fix the way we tell the kernel about really small exports,
* Removal of references to the no longer supported oldstyle from
all documentation
* Minor updates, clarifications, and syntax fixes for man pages
and other documentation
* Addition of a systemd unit file for nbd-client. This requires a
kernel which issues change events upon disconnect
(commit 37091fdd83), and a udev which correctly sets
SYSTEMD_READY
- Drop init.nbd-server and support for non systemd distributions
- Drop patches:
* nbd-2.9.25-close.diff (upstreamed)
* nbd-2.9.25-doxyfile.diff (no longer needed)
- Do not build doc subpackage
-------------------------------------------------------------------
Mon Feb 8 13:20:09 UTC 2016 - dmueller@suse.com

137
nbd.spec
View File

@@ -1,7 +1,7 @@
#
# spec file for package nbd
#
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2017 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
@@ -17,7 +17,7 @@
Name: nbd
Version: 3.13
Version: 3.15.2
Release: 0
Summary: Network Block Device Server and Client Utilities
License: GPL-2.0+
@@ -25,25 +25,15 @@ Group: Productivity/Networking/Other
Url: http://nbd.sourceforge.net/
Source0: http://downloads.sourceforge.net/project/%{name}/%{name}/%{version}/%{name}-%{version}.tar.xz
Source1: %{name}-server.service
Source2: init.nbd-server
Source3: config.example
Source4: nbd-server.sysconfig
Patch2: nbd-2.9.25-close.diff
Patch3: nbd-2.9.25-doxyfile.diff
BuildRequires: doxygen
BuildRequires: glib2-devel >= 2.26.0
BuildRequires: xz
BuildRequires: pkgconfig
BuildRequires: systemd-rpm-macros
BuildRequires: pkgconfig(glib-2.0) >= 2.26.0
BuildRequires: pkgconfig(gnutls)
Requires(pre): %fillup_prereq
Requires(pre): coreutils
Suggests: nbd-doc
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version} >= 1210
BuildRequires: systemd
BuildRequires: systemd-rpm-macros
%systemd_requires
%else
Requires(pre): %insserv_prereq
%endif
%description
This package contains nbd-server. It is the server backend for the nbd
@@ -63,100 +53,35 @@ the connection closes.
The package also contains the nbd-client tools, which you need to
configure the nbd devices on the client side.
%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.
%prep
%setup -q
%patch2 -p1
%patch3 -p1
%build
export CFLAGS="%{optflags} -fstack-protector -fno-strict-aliasing"
%configure
make %{?_smp_mflags}
doxygen doc/Doxyfile.in
%install
make install DESTDIR=%{buildroot} man_MANS='nbd-client.8 nbd-server.1 nbd-server.5 nbd-trdump.1'
mkdir -p %{buildroot}%{_sysconfdir}/init.d
mkdir -p %{buildroot}%{_prefix}/bin
%make_install
%if 0%{?suse_version} >= 1210
install -D -m 0644 %{SOURCE1} %{buildroot}/%{_unitdir}/%{name}-server.service
ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name}-server
%else
install %{SOURCE2} %{buildroot}%{_initddir}/nbd-server
ln -s ../..%{_initddir}/nbd-server %{buildroot}%{_sbindir}/rc%{name}-server
%endif
# install systemd unit
install -D -p -m 0644 %{SOURCE1} \
%{buildroot}/%{_unitdir}/%{name}-server.service
ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name}-server
%if 0%{?suse_version} >= 1210
# autoload nbd module
install -d -m 750 %{buildroot}/etc/modules-load.d/
echo "nbd" > %{buildroot}/etc/modules-load.d/%name.conf
%endif
install -d -m 750 %{buildroot}%{_prefix}/lib/modules-load.d/
echo "nbd" > %{buildroot}%{_prefix}/lib/modules-load.d/%{name}.conf
#echo "#Port file options" > $RPM_BUILD_ROOT/etc/nbd-server.conf
mkdir -p %{buildroot}%{_sysconfdir}/nbd-server
touch %{buildroot}%{_sysconfdir}/nbd-server/config
touch %{buildroot}%{_sysconfdir}/nbd-server/allow
install -D -m 0644 %{SOURCE3} %{buildroot}%{_sysconfdir}/nbd-server/config.example
install -D -m 0644 %{SOURCE4} %{buildroot}%{_localstatedir}/adm/fillup-templates/sysconfig.%{name}-server
%files
%defattr(-,root,root)
%attr(0755,root,root) %{_sbindir}/nbd-client
%attr(0755,root,root) %{_bindir}/nbd-server
%attr(0755,root,root) %{_bindir}/nbd-trdump
%{_sbindir}/rcnbd-server
%if 0%{?suse_version} >= 1210
%{_unitdir}/%{name}-server.service
%else
%{_initddir}/%{name}-server
%endif
%{_mandir}/man1/nbd-server.1.gz
%{_mandir}/man1/nbd-trdump.1.gz
%{_mandir}/man5/nbd-server.5.gz
%{_mandir}/man8/nbd-client.8.gz
%doc README.md
%dir %{_sysconfdir}/nbd-server
%ghost %config(noreplace) %{_sysconfdir}/nbd-server/config
%ghost %config(noreplace) %{_sysconfdir}/nbd-server/allow
%config %{_sysconfdir}/nbd-server/config.example
%if 0%{?suse_version} >= 1210
%{_sysconfdir}/modules-load.d/%name.conf
%endif
%{_localstatedir}/adm/fillup-templates/sysconfig.%{name}-server
%files doc
%defattr(-,root,root)
%doc doc/html
install -D -p -m 0644 %{SOURCE3} %{buildroot}%{_sysconfdir}/nbd-server/config.example
install -D -p -m 0644 %{SOURCE4} %{buildroot}%{_localstatedir}/adm/fillup-templates/sysconfig.%{name}-server
%post
%if 0%{?suse_version} >= 1210
%service_add_post %{name}-server.service
%fillup_only -n nbd-server
%else
%{fillup_and_insserv -f nbd-server}
%endif
if test -e %{_sysconfdir}/nbd-server.conf; then
# Do we have to create a generic section?
unset generic
@@ -179,23 +104,33 @@ if test -e %{_sysconfdir}/nbd-server.conf; then
fi
%postun
%if 0%{?suse_version} >= 1210
%service_del_postun %{name}-server.service
%else
%insserv_cleanup
%restart_on_update nbd-server
%endif
%pre
%if 0%{?suse_version} >= 1210
%service_add_pre %{name}-server.service
%endif
%preun
%if 0%{?suse_version} >= 1210
%service_del_preun %{name}-server.service
%else
%{stop_on_removal nbd-server}
%endif
%files
%defattr(-,root,root)
%{_sbindir}/nbd-client
%{_bindir}/nbd-server
%{_bindir}/nbd-trdump
%{_sbindir}/rcnbd-server
%{_unitdir}/%{name}-server.service
%{_mandir}/man1/nbd-server.1%{ext_man}
%{_mandir}/man1/nbd-trdump.1%{ext_man}
%{_mandir}/man5/nbd-server.5%{ext_man}
%{_mandir}/man8/nbd-client.8%{ext_man}
%{_mandir}/man5/nbdtab.5%{ext_man}
%doc README.md
%dir %{_sysconfdir}/nbd-server
%ghost %config(noreplace) %{_sysconfdir}/nbd-server/config
%ghost %config(noreplace) %{_sysconfdir}/nbd-server/allow
%config %{_sysconfdir}/nbd-server/config.example
%dir %{_prefix}/lib/modules-load.d/
%{_prefix}/lib/modules-load.d/nbd.conf
%{_localstatedir}/adm/fillup-templates/sysconfig.%{name}-server
%changelog