summaryrefslogtreecommitdiff
path: root/extra/ypbind-mt
diff options
context:
space:
mode:
authorroot <root@rshg047.dnsready.net>2011-06-09 22:46:45 +0000
committerroot <root@rshg047.dnsready.net>2011-06-09 22:46:45 +0000
commit8634a064b17334eb58699897220aeed2fc9a54db (patch)
tree8991573625a440a1f27d8da1abb3ae61fa4d0137 /extra/ypbind-mt
parent498f3fc095103b2a220a00b27d43f4dae02d5459 (diff)
Thu Jun 9 22:46:45 UTC 2011
Diffstat (limited to 'extra/ypbind-mt')
-rw-r--r--extra/ypbind-mt/PKGBUILD12
-rw-r--r--extra/ypbind-mt/nisdomainname.conf4
-rwxr-xr-xextra/ypbind-mt/ypbind55
3 files changed, 39 insertions, 32 deletions
diff --git a/extra/ypbind-mt/PKGBUILD b/extra/ypbind-mt/PKGBUILD
index ddb807725..45cf58258 100644
--- a/extra/ypbind-mt/PKGBUILD
+++ b/extra/ypbind-mt/PKGBUILD
@@ -1,23 +1,26 @@
-# $Id: PKGBUILD 123631 2011-05-11 23:05:30Z bisson $
+# $Id: PKGBUILD 126308 2011-06-04 12:37:21Z bisson $
# Maintainer: Gaetan Bisson <bisson@archlinux.org>
# Contributor: judd <jvinet@zeroflux.org>
# Contributor: Tom Newsom <Jeepster@gmx.co.uk>
pkgname=ypbind-mt
pkgver=1.33
-pkgrel=1
+pkgrel=2
pkgdesc='Linux NIS daemon'
arch=('i686' 'x86_64')
url='http://www.linux-nis.org/nis/ypbind-mt/'
license=('GPL2')
depends=('rpcbind' 'openslp')
-backup=('etc/yp.conf' 'etc/conf.d/ypbind')
+optdepends=('yp-tools: to set a domain name')
+backup=('etc/yp.conf' 'etc/conf.d/ypbind' 'etc/conf.d/nisdomainname')
source=("ftp://ftp.kernel.org/pub/linux/utils/net/NIS/$pkgname-$pkgver.tar.gz"
+ 'nisdomainname.conf'
'ypbind.conf'
'ypbind')
sha1sums=('49f578d15aa5d4f4130a2e96cd9c0e519263fc88'
+ 'eb00aecc0679e25a36b007e797f4468b40cb3e8e'
'07dee386d001fb9e9e6b76dda8af5b2092e5a4a2'
- '66f6ea2f622e0724e6017bf835d4f7f4a5bf9534')
+ '112fc2aedfe3f761325b69647b7938bc1be5bfcd')
build() {
cd "$srcdir/$pkgname-$pkgver"
@@ -31,5 +34,6 @@ package() {
install -D -m644 etc/yp.conf "$pkgdir"/etc/yp.conf
install -D -m755 ../ypbind "$pkgdir"/etc/rc.d/ypbind
install -D -m644 ../ypbind.conf "$pkgdir"/etc/conf.d/ypbind
+ install -D -m644 ../nisdomainname.conf "$pkgdir"/etc/conf.d/nisdomainname
install -d -m755 "$pkgdir"/var/yp/binding
}
diff --git a/extra/ypbind-mt/nisdomainname.conf b/extra/ypbind-mt/nisdomainname.conf
new file mode 100644
index 000000000..bbbbf8fc7
--- /dev/null
+++ b/extra/ypbind-mt/nisdomainname.conf
@@ -0,0 +1,4 @@
+#
+# NIS domain to be set in /etc/rc.d/ypbind
+#
+NISDOMAINNAME=""
diff --git a/extra/ypbind-mt/ypbind b/extra/ypbind-mt/ypbind
index 5ef5cf5b3..6a5ef11e3 100755
--- a/extra/ypbind-mt/ypbind
+++ b/extra/ypbind-mt/ypbind
@@ -2,35 +2,34 @@
. /etc/rc.conf
. /etc/rc.d/functions
+
. /etc/conf.d/ypbind
+. /etc/conf.d/nisdomainname
+
+name=ypbind
+PID=$(pidof -o %PPID /usr/sbin/ypbind)
case "$1" in
- start)
- stat_busy "Starting NIS Bind Daemon"
- [ -f /etc/defaultdomain ] && /bin/domainname -F /etc/defaultdomain
- /usr/sbin/ypbind $YPBIND_ARGS
- if [ $? -gt 0 ]; then
- stat_fail
- else
- add_daemon ypbind
- stat_done
- fi
- ;;
- stop)
- stat_busy "Stopping NIS Bind Daemon"
- killall -q /usr/sbin/ypbind
- if [ $? -gt 0 ]; then
- stat_fail
- else
- rm_daemon ypbind
- stat_done
- fi
- ;;
- restart)
- $0 stop
- sleep 1
- $0 start
- ;;
- *)
- echo "usage: $0 {start|stop|restart}"
+start)
+ stat_busy "Starting $name daemon"
+ [[ -n $NISDOMAINNAME ]] && /usr/bin/domainname "$NISDOMAINNAME" &>/dev/null
+ [[ -z "$PID" ]] && /usr/sbin/ypbind $YPBIND_ARGS &>/dev/null \
+ && { add_daemon $name; stat_done; } \
+ || { stat_fail; exit 1; }
+ ;;
+stop)
+ stat_busy "Stopping $name daemon"
+ [[ -n "$PID" ]] && kill $PID &>/dev/null \
+ && { rm_daemon $name; stat_done; } \
+ || { stat_fail; exit 1; }
+ ;;
+restart)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+*)
+ echo "usage: $0 {start|stop|restart}"
+ exit 1
+ ;;
esac