[nbd/f18: 5/5] New version. Systemd support files.

Christopher Meng cicku at fedoraproject.org
Mon Dec 2 03:54:23 UTC 2013


commit 4c89a4e68cb3513a939cf036e617612e0b91ec3d
Author: Christopher Meng <rpm at cicku.me>
Date:   Mon Dec 2 11:11:44 2013 +0800

    New version.
    Systemd support files.

 nbd-server.service   |   13 +++++++++++++
 nbd-server.sysconfig |    2 ++
 nbd.spec             |   46 +++++++++++++++++++++++++++++++++++-----------
 sources              |    2 +-
 4 files changed, 51 insertions(+), 12 deletions(-)
---
diff --git a/nbd-server.service b/nbd-server.service
new file mode 100644
index 0000000..75803e0
--- /dev/null
+++ b/nbd-server.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=Network Block Device server
+Documentation=man:nbd-server(1) man:nbd-server(5)
+After=syslog.target network.target
+
+[Service]
+Type=forking
+EnvironmentFile=/etc/sysconfig/nbd-server
+ExecStart=/usr/bin/nbd-server $OPTIONS
+PIDFile=/run/nbd-server.pid
+
+[Install]
+WantedBy=multi-user.target
diff --git a/nbd-server.sysconfig b/nbd-server.sysconfig
new file mode 100644
index 0000000..46cd23c
--- /dev/null
+++ b/nbd-server.sysconfig
@@ -0,0 +1,2 @@
+# Command line options for nbd-server 
+OPTIONS=""
diff --git a/nbd.spec b/nbd.spec
index 6163566..1fd6f8c 100644
--- a/nbd.spec
+++ b/nbd.spec
@@ -1,11 +1,17 @@
-Name:           nbd
-Version:        3.4
-Release:        1%{dist}
-Summary:        Network Block Device user-space tools (TCP version)
-License:        GPL+
-URL:            http://nbd.sourceforge.net
-Source0:        http://downloads.sourceforge.net/project/nbd/%{name}/%{version}/%{name}-%{version}.tar.bz2
-BuildRequires:  glib2-devel
+Name:              nbd
+Version:           3.5
+Release:           1%{dist}
+Summary:           Network Block Device user-space tools (TCP version)
+License:           GPL+
+URL:               http://nbd.sourceforge.net
+Source0:           http://downloads.sourceforge.net/project/nbd/%{name}/%{version}/%{name}-%{version}.tar.bz2
+Source1:           nbd-server.service
+Source2:           nbd-server.sysconfig
+BuildRequires:     glib2-devel
+BuildRequires:     systemd
+Requires(post):    systemd
+Requires(preun):   systemd
+Requires(postun):  systemd
 
 %description 
 Tools for the Linux Kernel's network block device, allowing you to use
@@ -15,20 +21,38 @@ remote block devices over a TCP/IP network.
 %setup -q
 
 %build
-%configure
+%configure --enable-syslog
 make %{?_smp_mflags}
 
 %install
 make install DESTDIR=%{buildroot}
+install -pm644 %{S:1} %{buildroot}%{_unitdir}/nbd-server.service
+install -pDm644 %{S:2} %{buildroot}%{_sysconfdir}/sysconfig/nbd-server
+
+%post
+%systemd_post %{S:1}
+
+%preun
+%systemd_preun %{S:1}
+
+%postun
+%systemd_postun_with_restart %{S:1}
 
 %files
 %doc README simple_test nbd-tester-client.c cliserv.h
-%{_mandir}/man*/nbd*
 %{_bindir}/nbd-server
-%{_sbindir}/nbd-client
 %{_bindir}/nbd-trdump
+%{_mandir}/man*/nbd*
+%{_sbindir}/nbd-client
+%config(noreplace) %{_sysconfdir}/sysconfig/nbd-server
+%{_unitdir}/nbd-server.service
 
 %changelog
+* Mon Dec 02 2013 Christopher Meng <rpm at cicku.me> - 3.5-1
+- Fix incorrect parsing of access control file in nbd-server(CVE-2013-6410).
+- Add systemd support for nbd-server(BZ#877518).
+- Enable logging to syslog.
+
 * Tue Sep 17 2013 Christopher Meng <rpm at cicku.me> - 3.4-1
 - New version.
 
diff --git a/sources b/sources
index aa69505..d6ecc72 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-40ce12dfe408288b4eab36103b48fec0  nbd-3.4.tar.bz2
+d89133bf9b681c17ed9d09a21b19f1ee  nbd-3.5.tar.bz2


More information about the scm-commits mailing list