summaryrefslogtreecommitdiff
path: root/extra/dhcp
diff options
context:
space:
mode:
authorroot <root@rshg047.dnsready.net>2011-04-15 04:55:43 +0000
committerroot <root@rshg047.dnsready.net>2011-04-15 04:55:43 +0000
commit7d13548d48c1e98b9c12201685fd6fef5e9388db (patch)
tree3aa20fadd718d86194b0e9cd5b4b3aef3b64ada9 /extra/dhcp
parent5611a56fd08da4e95cdf8de446dda50d7afa80c8 (diff)
Fri Apr 15 04:55:43 UTC 2011
Diffstat (limited to 'extra/dhcp')
-rw-r--r--extra/dhcp/PKGBUILD33
-rw-r--r--extra/dhcp/dhcp10
-rw-r--r--extra/dhcp/dhcp.install7
-rw-r--r--extra/dhcp/dhcp457
-rw-r--r--extra/dhcp/dhcp657
5 files changed, 149 insertions, 15 deletions
diff --git a/extra/dhcp/PKGBUILD b/extra/dhcp/PKGBUILD
index 3d157e1d6..34c3e4448 100644
--- a/extra/dhcp/PKGBUILD
+++ b/extra/dhcp/PKGBUILD
@@ -1,24 +1,25 @@
-# $Id: PKGBUILD 118234 2011-04-06 07:14:19Z jgc $
+# $Id: PKGBUILD 119729 2011-04-14 10:22:18Z daniel $
# Maintainer: Daniel Isenmann <daniel @archlinux.org>
pkgbase=dhcp
pkgname=('dhcp' 'dhclient')
# separate patch levels with a period to maintain proper versioning.
-pkgver=4.2.0.2
-_pkgver=4.2.0-P2
+pkgver=4.2.1.1
+_pkgver=4.2.1-P1
pkgrel=1
arch=('i686' 'x86_64')
license=('custom:isc-dhcp')
url="https://www.isc.org/software/dhcp"
source=(http://ftp.isc.org/isc/${pkgbase}/${pkgbase}-${_pkgver}.tar.gz
- dhcpd dhcp.conf.d
+ dhcp4 dhcp6 dhcp
dhcp-4.1.1-missing-ipv6-not-fatal.patch
dhclient-script-pathFixes.patch)
-md5sums=('a98f4ce3ca651e7e28a5a1ae6398689e'
- 'df22cffa7d7415ece7bb025b7bf774dd'
- '49da3192e5c885e3c7d02f447c2dea5e'
+md5sums=('22e6f1eff6d5cfe2621a06cc62ba5b70'
+ 'c49b1497837ba56c54e401a66e1bab9b'
+ '12c2f3ae47ed23eb698eb7f1bfd80f20'
+ '8f357e46e1efcbb746f38737a3f977a2'
'fd64aeb4f399dcc41ea43089a3811094'
'ddcc5cd576ec631ade6c4da21952b50b')
@@ -33,11 +34,13 @@ build() {
./configure --prefix=/usr --sysconfdir=/etc \
--with-srv-lease-file=/var/state/dhcp/dhcpd.leases \
- --with-srv6-lease-file=/var/state/dhcp/dhcpd6.leases
+ --with-srv6-lease-file=/var/state/dhcp/dhcpd6.leases \
+ --with-cli-lease-file=/var/state/dhclient/dhclient.leases \
+ --with-cli6-lease-file=/var/state/dhclient/dhclient6.leases
make
- patch -i ${srcdir}/dhclient-script-pathFixes.patch client/scripts/linux
+ patch -i ${srcdir}/dhclient-script-pathFixes.patch client/scripts/linux || return 1
}
package_dhcp(){
@@ -49,8 +52,9 @@ package_dhcp(){
cd ${srcdir}/${pkgbase}-${_pkgver}
make DESTDIR=${pkgdir} install
- install -D -m755 ${srcdir}/dhcpd ${pkgdir}/etc/rc.d/dhcpd
- install -D -m644 ${srcdir}/dhcp.conf.d ${pkgdir}/etc/conf.d/${pkgbase}
+ install -D -m755 ${srcdir}/dhcp4 ${pkgdir}/etc/rc.d/dhcp4
+ install -D -m755 ${srcdir}/dhcp6 ${pkgdir}/etc/rc.d/dhcp6
+ install -D -m644 ${srcdir}/dhcp ${pkgdir}/etc/conf.d/${pkgbase}
mkdir -p ${pkgdir}/var/state/dhcp
# Remove dhclient
@@ -62,16 +66,15 @@ package_dhcp(){
package_dhclient(){
pkgdesc="dhclient is standalone client from the dhcp package"
- depends=('bash')
+ depends=('bash' 'iproute2')
cd ${srcdir}/${pkgbase}-${_pkgver}
make -C client DESTDIR=${pkgdir} install
# move dhclient.conf to dhclient.conf.example
mv ${pkgdir}/etc/dhclient.conf{,.example}
-
- # directory needed for leasefiles
- mkdir -p ${pkgdir}/var/lib/dhclient
+
+ mkdir -p ${pkgdir}/var/state/dhclient
# install dhclient linux script
install -m755 -D client/scripts/linux ${pkgdir}/sbin/dhclient-script
diff --git a/extra/dhcp/dhcp b/extra/dhcp/dhcp
new file mode 100644
index 000000000..d4f228d9c
--- /dev/null
+++ b/extra/dhcp/dhcp
@@ -0,0 +1,10 @@
+#
+# Arguments to be passed to the DHCP server daemon
+#
+
+# ipv4 runtime parameters
+DHCP4_ARGS="-q"
+
+# ipv6 runtime parameters
+DHCP6_ARGS="-q"
+
diff --git a/extra/dhcp/dhcp.install b/extra/dhcp/dhcp.install
index c0ad39e36..5302be4b5 100644
--- a/extra/dhcp/dhcp.install
+++ b/extra/dhcp/dhcp.install
@@ -1,7 +1,14 @@
# arg 1: the new package version
post_install() {
[ -f var/state/dhcp/dhcpd.leases ] || : >var/state/dhcp/dhcpd.leases
+ [ -f var/state/dhcp/dhcpd6.leases ] || : >var/state/dhcp/dhcpd6.leases
#echo "If dhcpd doesn't start, ensure the ipv6 kernel module is loaded."
+
+ echo
+ echo "==> The dhcp server has now two rc.d scripts."
+ echo "==> Use '/etc/rc.d/dhcp6' to use IPv6 dhcp server or"
+ echo "==> '/etc/rc.d/dhcp4' to use IPv4 dhcp server."
+ echo "==> Make sure that you change your DAEMONS array in '/etc/rc.conf'!"
}
# arg 1: the new package version
diff --git a/extra/dhcp/dhcp4 b/extra/dhcp/dhcp4
new file mode 100644
index 000000000..8e1277a37
--- /dev/null
+++ b/extra/dhcp/dhcp4
@@ -0,0 +1,57 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+. /etc/conf.d/dhcp
+
+PIDFILE="/var/run/dhcpd.pid"
+
+if [[ -f $PIDFILE ]]; then
+ read -r PID < "$PIDFILE"
+
+ # prevent stale pidfiles from hanging around
+ if [[ ! -d /proc/$PID ]]; then
+ echo 'pid not found. deleteing stale pidfile'
+ unset PID
+ rm -f "$PIDFILE"
+ fi
+fi
+
+case "$1" in
+ start)
+ stat_busy "Starting DHCPv4 Server"
+ if [[ $PID ]]; then
+ stat_fail
+ exit 1
+ fi
+ if /usr/sbin/dhcpd -4 -pf "$PIDFILE" $DHCP4_ARGS; then
+ add_daemon dhcp4
+ stat_done
+ else
+ stat_fail
+ exit 1
+ fi
+ ;;
+ stop)
+ stat_busy "Stopping DHCPv4 Server"
+ if [[ ! $PID ]]; then
+ stat_fail
+ exit 1
+ fi
+ if { kill $PID && rm -f "$PIDFILE"; } &>/dev/null; then
+ rm_daemon dhcp4
+ stat_done
+ else
+ stat_fail
+ exit 1
+ fi
+ ;;
+ restart)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart}"
+esac
+
diff --git a/extra/dhcp/dhcp6 b/extra/dhcp/dhcp6
new file mode 100644
index 000000000..6b4b4d359
--- /dev/null
+++ b/extra/dhcp/dhcp6
@@ -0,0 +1,57 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+. /etc/conf.d/dhcp
+
+PIDFILE="/var/run/dhcp6.pid"
+
+if [[ -f $PIDFILE ]]; then
+ read -r PID < "$PIDFILE"
+
+ # prevent stale pidfiles from hanging around
+ if [[ ! -d /proc/$PID ]]; then
+ echo 'pid not found. deleteing stale pidfile'
+ unset PID
+ rm -f "$PIDFILE"
+ fi
+fi
+
+case "$1" in
+ start)
+ stat_busy "Starting DHCPv6 Server"
+ if [[ $PID ]]; then
+ stat_fail
+ exit 1
+ fi
+ if /usr/sbin/dhcpd -6 -pf "$PIDFILE" $DHCP6_ARGS; then
+ add_daemon dhcp6
+ stat_done
+ else
+ stat_fail
+ exit 1
+ fi
+ ;;
+ stop)
+ stat_busy "Stopping DHCPv6 Server"
+ if [[ ! $PID ]]; then
+ stat_fail
+ exit 1
+ fi
+ if { kill $PID && rm -f "$PIDFILE"; } &>/dev/null; then
+ rm_daemon dhcp6
+ stat_done
+ else
+ stat_fail
+ exit 1
+ fi
+ ;;
+ restart)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart}"
+esac
+