diff options
author | Parabola <dev@list.parabolagnulinux.org> | 2011-04-05 14:26:38 +0000 |
---|---|---|
committer | Parabola <dev@list.parabolagnulinux.org> | 2011-04-05 14:26:38 +0000 |
commit | 415856bdd4f48ab4f2732996f0bae58595092bbe (patch) | |
tree | ede2018b591f6dfb477fe9341ba17b9bc000fab9 /community/nbd |
Tue Apr 5 14:26:38 UTC 2011
Diffstat (limited to 'community/nbd')
-rw-r--r-- | community/nbd/PKGBUILD | 26 | ||||
-rw-r--r-- | community/nbd/nbd | 40 | ||||
-rw-r--r-- | community/nbd/nbd.conf.d | 8 |
3 files changed, 74 insertions, 0 deletions
diff --git a/community/nbd/PKGBUILD b/community/nbd/PKGBUILD new file mode 100644 index 000000000..64cf20044 --- /dev/null +++ b/community/nbd/PKGBUILD @@ -0,0 +1,26 @@ +# $Id: PKGBUILD 38970 2011-02-04 10:43:11Z ibiru $ +# Maintainer : Ionut Biru <ibiru@archlinux.org> +# Contributor: Gerhard Brauer <gerbra@archlinux.de> +pkgname=nbd +pkgver=2.9.20 +pkgrel=1 +pkgdesc="Tools for network block devices, allowing you to use remote block devices over TCP/IP." +arch=('i686' 'x86_64') +url="http://nbd.sourceforge.net" +license=('GPL') +source=(http://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.bz2 + nbd.conf.d nbd) +depends=('glib2') +md5sums=('aec35f6beb7bb4cb2ee267fe0f72c8d6' + '6d746f377a28b92dd2c80f01176cb811' + 'ab9c431881f5e3c98a8f6c04016f0e00') + +build(){ + cd "${srcdir}/${pkgname}-${pkgver}" + ./configure --prefix=/usr + make + make DESTDIR="${pkgdir}" install + + install -D -m644 "${srcdir}"/nbd.conf.d "${pkgdir}"/etc/conf.d/nbd + install -D -m755 "${srcdir}"/nbd "${pkgdir}"/etc/rc.d/nbd +} diff --git a/community/nbd/nbd b/community/nbd/nbd new file mode 100644 index 000000000..b2643196b --- /dev/null +++ b/community/nbd/nbd @@ -0,0 +1,40 @@ +#!/bin/bash + +. /etc/rc.conf +. /etc/rc.d/functions +. /etc/conf.d/nbd + +PIDFILE="/var/run/nbd-server.$NBD_PORT.pid" +PID=`cat $PIDFILE 2>/dev/null` +case "$1" in + start) + stat_busy "Starting Network Block Device Server" + if [ "$PID" = "" ]; then + /usr/bin/nbd-server $NBD_PORT $NBD_DEV $NBD_ARGS + fi + if [ "$PID" != "" -o $? -gt 0 ]; then + stat_fail + else + add_daemon nbd + stat_done + fi + ;; + stop) + stat_busy "Stopping Network Block Device Server" + [ ! -z "$PID" ] && kill $PID &> /dev/null + rm -f $PIDFILE + if [ $? -gt 0 ]; then + stat_fail + else + rm_daemon nbd + stat_done + fi + ;; + restart) + $0 stop + sleep 1 + $0 start + ;; + *) + echo "usage: $0 {start|stop|restart}" +esac diff --git a/community/nbd/nbd.conf.d b/community/nbd/nbd.conf.d new file mode 100644 index 000000000..d89ca09b1 --- /dev/null +++ b/community/nbd/nbd.conf.d @@ -0,0 +1,8 @@ +# +# Configuration for network block device (nbd) daemon +# + +NBD_PORT=2000 +NBD_DEV="/srv/http/sysrcd.dat" +NBD_ARGS="-r" + |