diff options
author | 2011-03-05 23:59:20 +0000 | |
---|---|---|
committer | 2011-03-05 23:59:20 +0000 | |
commit | 867d6cfb664f3e71f5e846019837e8ecda74e4b3 (patch) | |
tree | 2fb7ffb797be6e25d27480d2741264300cdde93c /net-misc | |
parent | old (diff) | |
download | historical-867d6cfb664f3e71f5e846019837e8ecda74e4b3.tar.gz historical-867d6cfb664f3e71f5e846019837e8ecda74e4b3.tar.bz2 historical-867d6cfb664f3e71f5e846019837e8ecda74e4b3.zip |
Version bump #309133 by Milan Dadok, #325605 by Stefan Behte, and #352897 by Paweł Hajdan, Jr. Add ldap support #160979 by Nico. Allow dhcp init.d script to be multiplexed #238277 by Roy Marples. Respect nogateway option by Laszlo Valko #265531 by Dmitry. Fix up chroot config checking by Lance Albertson #278335 by Arthur Hagen. Include full DHCPD_OPTS when checking the config #283352 by Marc. Update path to dhcrelay.pid #309129 by Milan Dadok.
Package-Manager: portage-2.1.9.25/cvs/Linux x86_64
Diffstat (limited to 'net-misc')
-rw-r--r-- | net-misc/dhcp/ChangeLog | 19 | ||||
-rw-r--r-- | net-misc/dhcp/Manifest | 22 | ||||
-rw-r--r-- | net-misc/dhcp/dhcp-4.2.1.ebuild | 204 | ||||
-rw-r--r-- | net-misc/dhcp/files/dhcp-4.2.0-errwarn-message.patch | 31 | ||||
-rw-r--r-- | net-misc/dhcp/files/dhcp-4.2.1-dhclient-resolvconf.patch | 384 | ||||
-rw-r--r-- | net-misc/dhcp/files/dhcp-4.2.1-nogateway.patch | 46 | ||||
-rwxr-xr-x | net-misc/dhcp/files/dhcpd.init3 | 94 | ||||
-rwxr-xr-x | net-misc/dhcp/files/dhcrelay.init2 | 29 |
8 files changed, 813 insertions, 16 deletions
diff --git a/net-misc/dhcp/ChangeLog b/net-misc/dhcp/ChangeLog index 080b3762fcee..9e69182a9a1c 100644 --- a/net-misc/dhcp/ChangeLog +++ b/net-misc/dhcp/ChangeLog @@ -1,6 +1,21 @@ # ChangeLog for net-misc/dhcp -# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-misc/dhcp/ChangeLog,v 1.167 2010/10/15 05:15:23 robbat2 Exp $ +# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/net-misc/dhcp/ChangeLog,v 1.168 2011/03/05 23:59:20 vapier Exp $ + +*dhcp-4.2.1 (05 Mar 2011) + + 05 Mar 2011; Mike Frysinger <vapier@gentoo.org> + +files/dhcp-4.2.0-errwarn-message.patch, +dhcp-4.2.1.ebuild, + +files/dhcp-4.2.1-dhclient-resolvconf.patch, + +files/dhcp-4.2.1-nogateway.patch, +files/dhcpd.init3, + +files/dhcrelay.init2: + Version bump #309133 by Milan Dadok, #325605 by Stefan Behte, and #352897 + by Paweł Hajdan, Jr. Add ldap support #160979 by Nico. Allow dhcp init.d + script to be multiplexed #238277 by Roy Marples. Respect nogateway option + by Laszlo Valko #265531 by Dmitry. Fix up chroot config checking by Lance + Albertson #278335 by Arthur Hagen. Include full DHCPD_OPTS when checking + the config #283352 by Marc. Update path to dhcrelay.pid #309129 by Milan + Dadok. *dhcp-3.1.3_p1 (15 Oct 2010) diff --git a/net-misc/dhcp/Manifest b/net-misc/dhcp/Manifest index d31fd2123066..72b931de7484 100644 --- a/net-misc/dhcp/Manifest +++ b/net-misc/dhcp/Manifest @@ -20,36 +20,30 @@ AUX dhcp-3.1.0a1-dhclient-resolvconf.patch 10316 RMD160 183bedd1660bf5a5f9dc7d00 AUX dhcp-3.1.1-CVE-2009-0692.patch 494 RMD160 42d3490a34b9559a9c0f335c2a3b8c8a2105d55f SHA1 e1c6da730672194b1771f0729c7d9f08073dfa6e SHA256 df77ad202d11e21355ed92bf015286fcd2f28ae21302283ab570ea4d9b9632af AUX dhcp-3.1.2_p1-CVE-2009-1892.patch 427 RMD160 fe7daa6834faa0f6078ef125525f6a2db0c05f37 SHA1 eb6dcedecef536f743e97e7d0b5eea0a08f5e55a SHA256 55bb136138b76d6fa9c9165b348fb2c6975b935b3bba72ea551fc8bcae4fcc9b AUX dhcp-3.1.3-dhclient-no-down.patch 2762 RMD160 bea58f58f745cbcee5d2d43f0dbabe54a1eaaafa SHA1 6ceb33afe42734b21b5ea91076b06c4fb4e9b81f SHA256 94c9dbe45063c6c600976ffab4c1fc9ac6f52f4e8077b5074f5142816ea626c4 -AUX dhcp-4.0-dhclient-metric.patch 8100 RMD160 cd599d5523be30809024b8e0f81cd84e4d932317 SHA1 ba9ff19cc5274b0e3e8408eba4725e0546413954 SHA256 a1c5589ac1c57ba7fe66336646f4286ebd7112f05abf5ae59b69ff26e7409afc AUX dhcp-4.0-dhclient-ntp.patch 7966 RMD160 d6dd1c3363f06712a82231eae1eb559f5a45bbb5 SHA1 3c1b373c6649c1ccb44f205fbee116c134514f4e SHA256 e93bda7f2baae9163f96ab0408bfbe885caa96a8698f9e566b8a9dc04de9359b -AUX dhcp-4.0-dhclient-resolvconf.patch 14516 RMD160 0a53cbb795c4d4989f5632b6314b69be5bd94611 SHA1 e1db8ecca4de1c45fcec7e93fb13d186931d74f6 SHA256 1cdbb9ed297426b2d44063ffb8642c9c5cdf54dc2f9c3c8f59100f4ab2c40986 -AUX dhcp-4.0-dhclient-script-correct-operators.patch 1382 RMD160 3a37a68c5e9ab44b6f885e1e644f6138557ba45c SHA1 c5459430398b9c92ce9585672860abc6d247c451 SHA256 f5f1a75e9873b141d4b0a0f4fde911e6dfdddf13985e28e1789029ef7a072dfb -AUX dhcp-4.0-dhclient-stdin-conf.patch 3009 RMD160 749a3768dd709b54ad0ce6fc53828e8e777f32c7 SHA1 49d2a5db802431d894c0c790addd7c6752be7070 SHA256 b3136285b6a9099ac1018d768b072c03bd136c1b5bffa58e48c5101dfe79cd83 -AUX dhcp-4.0-linux-ipv6-header.patch 817 RMD160 cd395ba33c6e729862af7a3c869d412e91ad5b41 SHA1 1e268892009a58caa8b6030be192a25583a96dd5 SHA256 dbb6f22c99dcf31fd91f89061398dea194476d37a1e328736adaff6fe2f00c6d -AUX dhcp-4.0-no_isc_blurb.patch 2748 RMD160 f29d8705fab63320c18c6319dd5703a51acc1687 SHA1 d8af8f4567e4bdbfac5d8e5455dede87a188ad40 SHA256 603e9a6f28264e35513f40f987d10e4fdce6d5e4f8d48aa46f83b8687d57dff0 -AUX dhcp-4.0-paranoia.patch 4996 RMD160 2f8339e3d8af9164c91cc5a3bab7605ecd728295 SHA1 94db8a07b82b69d0a05645b08ef5d0ec0b99bd19 SHA256 14d328d400cdc1b4d7d6329d9c8e997b2c5e76e8f21330e267a75d6240799058 AUX dhcp-4.0.1-dhclient-stdin-conf.patch 2965 RMD160 2c3dd3994f0a7f15f3fe51972dd04a2e6055613a SHA1 f4a9d51126ea489f75fcf29053ab432b68e5055d SHA256 0b25bc74ae258656dd1f0e6f4ffd6b4ef8b4ad56956624c0b6070941a180e57c -AUX dhcp-4.1-dhclient-metric.patch 7493 RMD160 59131eb3645b80e666b0741324992f10545213e4 SHA1 ec7fedbc46efe882c172eb07613711cccc0bce73 SHA256 405027d4ed4aa4cf8df8e0972c543885f1a2c077483eac6771a58b84bee2a343 -AUX dhcp-4.1-no_isc_blurb.patch 2711 RMD160 6b6816756fc899a1bb108281faa4765fcf1d09f7 SHA1 5f010721ee2fd39232fc15ef18faccce6d15e3fe SHA256 c9a17ac6695fa29b016f9dc024b648641b3958ffb2c9740671a9f9c5e8b8e52e +AUX dhcp-4.2.0-errwarn-message.patch 1508 RMD160 604c680c22b620ae11e4c1ab83902a0c3dacaa62 SHA1 8d645f2510dac8c68d6114cb3f3c0077d832f8c0 SHA256 e2baa7b6097a6ca20b66afcd7b0e399840a8b0f251b3750a49a03f0d5b714231 +AUX dhcp-4.2.1-dhclient-resolvconf.patch 13742 RMD160 e226e793ab4d1302dbaf288c3077f3f6c8758b97 SHA1 d4ea97c3383c7f7769ab36c8d36674a3297dc1f9 SHA256 ddc284623b421098702d3e0cc1849b37c015e78dc510aa7efdd2e5fc9b6a849c +AUX dhcp-4.2.1-nogateway.patch 1648 RMD160 820956e072e4a84ffabdee6714377ae23827b7bf SHA1 5c6c8118ee6b4b8524451827756aab052766ca09 SHA256 694caca5fbcf900cef2223307a43fb21a66fd672728cebfd873313730029acc4 AUX dhcpd.conf 1092 RMD160 936bb112c7cdf8e669b695599252d1f6626be2f3 SHA1 cbabbcea73a0cbc9692462683b983c96d6f18b0c SHA256 b86d27e0560689057b01a352474582fceb3a398eaf3b17f901378ec56284c4d5 AUX dhcpd.init 1989 RMD160 7f6b6858020100e47efa5d6a0809b2959e551249 SHA1 2c611adc6425fd095740aa56d09d8aafb4fea58a SHA256 916bfeb81dcb3423fd4239270ac2dce2e6dc105b28a06e03b352f6bf6b30ed1e AUX dhcpd.init2 2421 RMD160 baa01ae97b227edba7653cd51735613be2dac652 SHA1 f2068ceb2d79d7992f46b31e6a6e3277a0167dce SHA256 fef93e5a7264780044a977ade27e9cc70de824063791bcd07d3db81c11c16df5 +AUX dhcpd.init3 2525 RMD160 d56c77e6f2e3981c78c3fefad04347615e9d9d60 SHA1 c04f470d0cc3b262cf87cc766ceee5a35aec8b43 SHA256 69f5e6bee391a9a03554bead07c9dd5775e1fbb2a0ae515b7930cec328a8959c AUX dhcrelay.conf 421 RMD160 456edbc9bcc8d3a44db5bb6dbf0c3003c3e7419c SHA1 78ecdb000382893fb49d0052ced063955b0ad9cf SHA256 409b895ed489e75c1a08f72961b45d641b93fd9357f528abc78b1fd036b7f730 AUX dhcrelay.init 736 RMD160 04566b87bd6dbb8bb754b26409ca30b878ef3ca3 SHA1 72742b308314b2e1476b27e94212fbf4d179adc4 SHA256 cfdaff3a723be3935d06c14e171d4008f2ad3329bd05ac2e49c19bc0e14bc59c +AUX dhcrelay.init2 713 RMD160 3de579e9c4544d55114c18886a7aa73a70621516 SHA1 5978ec44a7e85492c510be1a797a3dfc5dabcd05 SHA256 2cd189f463251c6ce5c6e816b9e19db0a742ace97b530f53d61a77b1cb52db20 DIST dhcp-3.1-ESV.tar.gz 797454 RMD160 c6a8d943240dde72d47bb9bfbd740ff6e68ceee9 SHA1 e1cce81ead844fbdaf7ad99ba1146efa0b8b72c0 SHA256 e316b7dc34f05e38724273a473f823719281f229a71a80bc358f8e74687fd7d7 DIST dhcp-3.1.1.tar.gz 798228 RMD160 08ed15d26ca64928e1d3b07c631cbbfa9a3dc8cb SHA1 3f7e013cb62aed0f3af45bdd97424d8b63e9c280 SHA256 129024c7545e3e8d37e75cd5d534b50c53955592c4935189a57916e216355f6d DIST dhcp-3.1.2.tar.gz 799626 RMD160 026ac48b176ec273397fafa8a834a21fd6331681 SHA1 a60cccec2402a35025ddaafc8ac896595188560e SHA256 80daba1e4ac220a0945778aa3c1c9eb7860c4426645660bebb8ed35a3231a2fb DIST dhcp-3.1.2p1.tar.gz 792355 RMD160 53434f8404c69e8e113cad030ec975cf13b467cc SHA1 730214fa6e70d187f1492aa3d4f1c2868ffcc8de SHA256 e0cb405e0fef0ecebec7aaed294032a06178ff28be87498596e6069ccda4341e DIST dhcp-3.1.3.tar.gz 804097 RMD160 2337d1cc29e7be8ac973d8bfec633367dd37c12a SHA1 92fea5036c38a840f2f944b6cd1d90b18f950b7c SHA256 cb363247a897beaf5708c98d3a80dba8edd8f639d6bd1f4ada6c5a64ba51e2d4 -DIST dhcp-4.0.1.tar.gz 1050570 RMD160 a9764a76d105778362fe4b58e77783331ee3448a SHA1 7d813740ab4a64e474f1c01b1395617987532ed1 SHA256 965d09a7759250eff7d6d06d37425ea085c14edb5b405f8357ef5ec72ded28ef -DIST dhcp-4.1.0.tar.gz 1086815 RMD160 bf96fa9d135a65b4d9b27f8caf4f3744f0636c80 SHA1 46e161892140a3b60cd56e62b442f48f51bc605f SHA256 688741e970410efdb177513550f8cd1ee52032eb109313ab316a852f40310914 +DIST dhcp-4.2.1.tar.gz 8795980 RMD160 8ecb0608f2cdb660d27ce48b9ba09c64bb7af995 SHA1 dc9be6d2d458a5a7a921eb08281a431506fcca17 SHA256 5f10bb28740c3bd2c632f6dbd9de53fb7e9db07cd274c60c7c1884ae6d5870a1 EBUILD dhcp-3.1.1-r1.ebuild 7581 RMD160 e3012da6c7602544a882dcc99059394eceb0ad1d SHA1 a78bf9beee75424a4c0dbdeeb79113a8d66b49b9 SHA256 2dbc3118d7955e0b31e63737732e413923810485ea929499231d41091379dc64 EBUILD dhcp-3.1.1.ebuild 7430 RMD160 33dd30be2b4e210493421f4a50767f81ec7edb29 SHA1 33493ba5fbc4f8fbf03cad5218b7e53c413872ac SHA256 a594c7c0e519a8b9a1522c8a4033abf8d392f2675a159c4351bf41f1a5ba586d EBUILD dhcp-3.1.2.ebuild 7470 RMD160 ce4c0c3c3122040ca19103c37981444a1429c160 SHA1 dca8a1670ffb298c32089ca58bfdc4019f3a357e SHA256 40e5f159eff7a142f64d2511d06536bd97e46170cf371d9ad2ebd9c74d61b02f EBUILD dhcp-3.1.2_p1.ebuild 7606 RMD160 4a092fb0f8337065432ad475193633dca2b381e1 SHA1 e883fef011969302fad6ede0977cb6e1a8387dc7 SHA256 765bcec429ccff09c85b0e466da0673813ed4440cdf31c316698e798892dc37d EBUILD dhcp-3.1.3.ebuild 7697 RMD160 e30124e79caf736ad90aa90d91e23d7a0c193041 SHA1 d80cc702b12b017a1e17b363c12c103700cdd128 SHA256 36b770e0d9d337567144df45393f049f67a57ecbb08dd9d1361b27a88ab6d5a0 EBUILD dhcp-3.1.3_p1.ebuild 7772 RMD160 745ce5aa7dee055263c9518585c3c0b1bdfd54a8 SHA1 e19623ad15676759b79b50d103e72dd9ea3f6312 SHA256 9f82707e790928beef947dc872a10698d6ed60838a63d616c8cb0d97d2ade5cd -EBUILD dhcp-4.0.1.ebuild 6744 RMD160 dcd9eb3251fdeb283b9ef285cc63b7253dcf01c9 SHA1 c3f78ed12faf8924e43cb35cfc81f9096ede35f5 SHA256 68f9a416ba63c1403265c12a42d86b10e6d0aca3591e85d6beb419c082e433de -EBUILD dhcp-4.1.0.ebuild 6703 RMD160 095f3abdab681e9ad7fd6820e159d295eb0e4892 SHA1 ef553a729eb8cd8f66a1bdca6024b5edb5864393 SHA256 a70d305090bc716e807861e154363f4b478852ad7c7d5f1ef8d5f45fb4ffea4d -MISC ChangeLog 28653 RMD160 4048317c30c1970f54d40386b48cd76aa1d38005 SHA1 1c6129b4c6894692f96e05124ffe3a44de917050 SHA256 1224cc00c43658aae63d43bc32bad08f8f8880565bddb28de4101b961ee88c8a +EBUILD dhcp-4.2.1.ebuild 6194 RMD160 1035b980b6839f750fcc3c98228dba698fa66321 SHA1 713afe99bd4eea6c8a40d680bb92d1a76513ccf4 SHA256 d2d5d50958f1b24f98d04d46b865f0bc620e15bef17b255e4e6c61f7281317bb +MISC ChangeLog 29385 RMD160 9ec4ba026b787822a87ddcb754f539e10e01a9ae SHA1 4d843bdfaf662e090adf420b6bbe556bbe946857 SHA256 0dc8fb2aa1b9c33a4768f6b6974ba241a7cbff949f617e7c25f0b85a4c14bd95 MISC metadata.xml 358 RMD160 97ecd4b6ee0a24352a71a66d5ad4fd82481156b4 SHA1 d80da2cf7c6892cdad6b681fda29e46472d68871 SHA256 8665f24cdfcc09576b595f8bd257333ff5f9ea7ee0ca2925ba6fb74d90e12415 diff --git a/net-misc/dhcp/dhcp-4.2.1.ebuild b/net-misc/dhcp/dhcp-4.2.1.ebuild new file mode 100644 index 000000000000..e21a9e7d7d2e --- /dev/null +++ b/net-misc/dhcp/dhcp-4.2.1.ebuild @@ -0,0 +1,204 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-misc/dhcp/dhcp-4.2.1.ebuild,v 1.1 2011/03/05 23:59:20 vapier Exp $ + +EAPI="2" + +inherit eutils + +MY_PV="${PV//_alpha/a}" +MY_PV="${MY_PV//_beta/b}" +MY_PV="${MY_PV//_rc/rc}" +MY_PV="${MY_PV//_p/-P}" +MY_P="${PN}-${MY_PV}" +DESCRIPTION="ISC Dynamic Host Configuration Protocol (DHCP) client/server" +HOMEPAGE="http://www.isc.org/products/DHCP" +SRC_URI="ftp://ftp.isc.org/isc/dhcp/${MY_P}.tar.gz" + +LICENSE="as-is BSD" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~sparc-fbsd ~x86 ~x86-fbsd" +IUSE="doc ipv6 ldap selinux ssl kernel_linux vim-syntax" + +DEPEND="selinux? ( sec-policy/selinux-dhcp ) + kernel_linux? ( sys-apps/net-tools ) + vim-syntax? ( app-vim/dhcpd-syntax ) + ldap? ( + net-nds/openldap + ssl? ( dev-libs/openssl ) + )" + +PROVIDE="virtual/dhcpc" + +S="${WORKDIR}/${MY_P}" + +src_prepare() { + # Gentoo patches - these will probably never be accepted upstream + # Fix some permission issues + epatch "${FILESDIR}"/${PN}-3.0-fix-perms.patch + # Enable dhclient to equery NTP servers + epatch "${FILESDIR}"/${PN}-4.0-dhclient-ntp.patch + # resolvconf support in dhclient-script + epatch "${FILESDIR}"/${PN}-4.2.1-dhclient-resolvconf.patch + # Stop downing the interface on Linux as that breaks link daemons + # such as wpa_supplicant and netplug + epatch "${FILESDIR}"/${PN}-3.0.3-dhclient-no-down.patch + epatch "${FILESDIR}"/${PN}-4.2.0-errwarn-message.patch + # Enable dhclient to get extra configuration from stdin + epatch "${FILESDIR}"/${PN}-4.0.1-dhclient-stdin-conf.patch + epatch "${FILESDIR}"/${PN}-4.2.1-nogateway.patch #265531 + + # NetworkManager support patches + # If they fail to apply to future versions they will be dropped + # Add dbus support to dhclient + epatch "${FILESDIR}"/${PN}-3.0.3-dhclient-dbus.patch + + # Brand the version with Gentoo + sed -i \ + -e "/VERSION=/s:'$: Gentoo-${PR}':" \ + configure || die + + # Change the hook script locations of the scripts + sed -i \ + -e 's,/etc/dhclient-exit-hooks,/etc/dhcp/dhclient-exit-hooks,g' \ + -e 's,/etc/dhclient-enter-hooks,/etc/dhcp/dhclient-enter-hooks,g' \ + client/scripts/* || die + + # No need for the linux script to force bash, #158540. + sed -i -e 's,#!/bin/bash,#!/bin/sh,' client/scripts/linux || die + + # Quiet the freebsd logger a little + sed -i -e '/LOGGER=/ s/-s -p user.notice //g' client/scripts/freebsd || die + + # Remove these options from the sample config + sed -i \ + -e "/\(script\|host-name\|domain-name\) / d" \ + client/dhclient.conf || die + + # Only install different man pages if we don't have en + if [[ " ${LINGUAS} " != *" en "* ]]; then + # Install Japanese man pages + if [[ " ${LINGUAS} " == *" ja "* && -d doc/ja_JP.eucJP ]]; then + einfo "Installing Japanese documention" + cp doc/ja_JP.eucJP/dhclient* client + cp doc/ja_JP.eucJP/dhcp* common + fi + fi + # Now remove the non-english docs so there are no errors later + rm -rf doc/ja_JP.eucJP +} + +src_configure() { + econf \ + --enable-paranoia \ + --sysconfdir=/etc/dhcp \ + --with-cli-pid-file=/var/run/dhcp/dhclient.pid \ + --with-cli-lease-file=/var/lib/dhcp/dhclient.leases \ + --with-cli6-pid-file=/var/run/dhcp/dhclient6.pid \ + --with-cli6-lease-file=/var/lib/dhcp/dhclient6.leases \ + --with-srv-pid-file=/var/run/dhcp/dhcpd.pid \ + --with-srv-lease-file=/var/lib/dhcp/dhcpd.leases \ + --with-srv6-pid-file=/var/run/dhcp/dhcpd6.pid \ + --with-srv6-lease-file=/var/lib/dhcp/dhcpd6.leases \ + --with-relay-pid-file=/var/run/dhcp/dhcrelay.pid \ + $(use_enable ipv6 dhcpv6) \ + $(use_with ldap) \ + $(use ldap && use_with ssl ldapcrypto || echo --without-ldapcrypto) +} + +src_install() { + emake install DESTDIR="${D}" || die + + # move the client to / + dodir /sbin + mv "${D}"/usr/sbin/dhclient "${D}"/sbin/ || die + + exeinto /sbin + if use kernel_linux ; then + newexe "${S}"/client/scripts/linux dhclient-script || die + else + newexe "${S}"/client/scripts/freebsd dhclient-script || die + fi + + if use ldap ; then + insinto /etc/openldap/schema + doins contrib/ldap/dhcp.* || die + dosbin contrib/ldap/dhcpd-conf-to-ldap || die + fi + + use doc && dodoc README RELNOTES doc/* + + insinto /etc/dhcp + doins client/dhclient.conf server/dhcpd.conf || die + newinitd "${FILESDIR}"/dhcpd.init3 dhcpd + newinitd "${FILESDIR}"/dhcrelay.init2 dhcrelay + newconfd "${FILESDIR}"/dhcpd.conf dhcpd + newconfd "${FILESDIR}"/dhcrelay.conf dhcrelay + + keepdir /var/{lib,run}/dhcp + keepdir /var/lib/dhclient +} + +pkg_preinst() { + enewgroup dhcp + enewuser dhcp -1 -1 /var/lib/dhcp dhcp + + # Keep the user files over the sample ones + local f + for f in dhclient dhcpd ; do + f="/etc/dhcp/${f}.conf" + if [ -e "${ROOT}"${f} ] ; then + cp -p "${ROOT}"${f} "${D}"${f} + fi + done +} + +pkg_postinst() { + chown -R dhcp:dhcp "${ROOT}"/var/{lib,run}/dhcp + + if [[ -e "${ROOT}"/etc/init.d/dhcp ]] ; then + ewarn + ewarn "WARNING: The dhcp init script has been renamed to dhcpd" + ewarn "/etc/init.d/dhcp and /etc/conf.d/dhcp need to be removed and" + ewarn "and dhcp should be removed from the default runlevel" + ewarn + fi + + einfo "You can edit /etc/conf.d/dhcpd to customize dhcp settings." + einfo + einfo "If you would like to run dhcpd in a chroot, simply configure the" + einfo "DHCPD_CHROOT directory in /etc/conf.d/dhcpd and then run:" + einfo " emerge --config =${PF}" +} + +pkg_config() { + local CHROOT="$( + sed -n -e 's/^[[:blank:]]\?DHCPD_CHROOT="*\([^#"]\+\)"*/\1/p' \ + "${ROOT}"/etc/conf.d/dhcpd + )" + + if [[ -z ${CHROOT} ]]; then + eerror "CHROOT not defined in /etc/conf.d/dhcpd" + return 1 + fi + + CHROOT="${ROOT}/${CHROOT}" + + if [[ -d ${CHROOT} ]] ; then + ewarn "${CHROOT} already exists - aborting" + return 0 + fi + + ebegin "Setting up the chroot directory" + mkdir -m 0755 -p "${CHROOT}/"{dev,etc,var/lib,var/run/dhcp} + cp /etc/{localtime,resolv.conf} "${CHROOT}"/etc + cp -R /etc/dhcp "${CHROOT}"/etc + cp -R /var/lib/dhcp "${CHROOT}"/var/lib + ln -s ../../var/lib/dhcp "${CHROOT}"/etc/dhcp/lib + chown -R dhcp:dhcp "${CHROOT}"/var/{lib,run}/dhcp + eend 0 + + local logger="$(best_version virtual/logger)" + einfo "To enable logging from the dhcpd server, configure your" + einfo "logger (${logger}) to listen on ${CHROOT}/dev/log" +} diff --git a/net-misc/dhcp/files/dhcp-4.2.0-errwarn-message.patch b/net-misc/dhcp/files/dhcp-4.2.0-errwarn-message.patch new file mode 100644 index 000000000000..f882a1345f35 --- /dev/null +++ b/net-misc/dhcp/files/dhcp-4.2.0-errwarn-message.patch @@ -0,0 +1,31 @@ +ripped from Fedora & tweaked + +--- dhcp-4.2.0/omapip/errwarn.c ++++ dhcp-4.2.0/omapip/errwarn.c +@@ -76,20 +76,13 @@ + + #if !defined (NOMINUM) + log_error ("%s", ""); +- log_error ("If you did not get this software from ftp.isc.org, please"); +- log_error ("get the latest from ftp.isc.org and install that before"); +- log_error ("requesting help."); ++ log_error ("This version of ISC DHCP is based on the release available"); ++ log_error ("on ftp.isc.org. Features have been added and other changes"); ++ log_error ("have been made to the base software release in order to make"); ++ log_error ("it work better with this distribution."); + log_error ("%s", ""); +- log_error ("If you did get this software from ftp.isc.org and have not"); +- log_error ("yet read the README, please read it before requesting help."); +- log_error ("If you intend to request help from the dhcp-server@isc.org"); +- log_error ("mailing list, please read the section on the README about"); +- log_error ("submitting bug reports and requests for help."); +- log_error ("%s", ""); +- log_error ("Please do not under any circumstances send requests for"); +- log_error ("help directly to the authors of this software - please"); +- log_error ("send them to the appropriate mailing list as described in"); +- log_error ("the README file."); ++ log_error ("Please report for this software via the Gentoo Bugzilla site:"); ++ log_error (" http://bugs.gentoo.org/"); + log_error ("%s", ""); + log_error ("exiting."); + #endif diff --git a/net-misc/dhcp/files/dhcp-4.2.1-dhclient-resolvconf.patch b/net-misc/dhcp/files/dhcp-4.2.1-dhclient-resolvconf.patch new file mode 100644 index 000000000000..6d8caecdf938 --- /dev/null +++ b/net-misc/dhcp/files/dhcp-4.2.1-dhclient-resolvconf.patch @@ -0,0 +1,384 @@ +--- a/client/scripts/bsdos ++++ b/client/scripts/bsdos +@@ -1,34 +1,41 @@ + #!/bin/sh + + make_resolv_conf() { ++ if [ x"$PEER_DNS" != x ] && [ x$"PEER_DNS" != xyes ]; then ++ return 0 ++ fi ++ local conf= + if [ x"$new_domain_name_servers" != x ]; then +- cat /dev/null > /etc/resolv.conf.dhclient + if [ "x$new_domain_search" != x ]; then +- echo search $new_domain_search >> /etc/resolv.conf.dhclient ++ conf="${conf}search ${new_domain_search}\n" + elif [ "x$new_domain_name" != x ]; then + # Note that the DHCP 'Domain Name Option' is really just a domain + # name, and that this practice of using the domain name option as + # a search path is both nonstandard and deprecated. +- echo search $new_domain_name >> /etc/resolv.conf.dhclient ++ conf="${conf}search ${new_domain_name}\n" + fi + for nameserver in $new_domain_name_servers; do +- echo nameserver $nameserver >> /etc/resolv.conf.dhclient ++ conf="${conf}nameserver ${nameserver}\n" + done +- +- mv /etc/resolv.conf.dhclient /etc/resolv.conf + elif [ "x${new_dhcp6_name_servers}" != x ] ; then +- cat /dev/null > /etc/resolv.conf.dhclient6 +- chmod 644 /etc/resolv.conf.dhclient6 +- + if [ "x${new_dhcp6_domain_search}" != x ] ; then +- echo search ${new_dhcp6_domain_search} >> /etc/resolv.conf.dhclient6 ++ conf="${conf}search ${new_dhcp6_domain_search}\n" + fi + for nameserver in ${new_dhcp6_name_servers} ; do +- echo nameserver ${nameserver} >> /etc/resolv.conf.dhclient6 ++ conf="${conf}nameserver ${nameserver}\n" + done ++ fi + +- mv /etc/resolv.conf.dhclient6 /etc/resolv.conf ++ if [ x"$conf" != x ]; then ++ conf="# Generated by dhclient or interface $interface\n${conf}" ++ if type resolvconf >/dev/null 2>&1; then ++ printf "${conf}" | resolvconf -a $interface ++ else ++ printf "${conf}" > /etc/resolv.conf ++ chmod 644 /etc/resolv.conf ++ fi + fi ++ + # If we're making confs, may as well make an ntp.conf too + make_ntp_conf + } +--- a/client/scripts/freebsd ++++ b/client/scripts/freebsd +@@ -11,68 +11,41 @@ + fi + + make_resolv_conf() { ++ if [ x"$PEER_DNS" != x ] && [ x$"PEER_DNS" != xyes ]; then ++ return 0 ++ fi ++ local conf= + if [ x"$new_domain_name_servers" != x ]; then +- ( cat /dev/null > /etc/resolv.conf.dhclient ) +- exit_status=$? +- if [ $exit_status -ne 0 ]; then +- $LOGGER "Unable to create /etc/resolv.conf.dhclient: Error $exit_status" +- else +- if [ "x$new_domain_search" != x ]; then +- ( echo search $new_domain_search >> /etc/resolv.conf.dhclient ) +- exit_status=$? +- elif [ "x$new_domain_name" != x ]; then +- # Note that the DHCP 'Domain Name Option' is really just a domain +- # name, and that this practice of using the domain name option as +- # a search path is both nonstandard and deprecated. +- ( echo search $new_domain_name >> /etc/resolv.conf.dhclient ) +- exit_status=$? +- fi +- for nameserver in $new_domain_name_servers; do +- if [ $exit_status -ne 0 ]; then +- break +- fi +- ( echo nameserver $nameserver >>/etc/resolv.conf.dhclient ) +- exit_status=$? +- done +- +- # If there were no errors, attempt to mv the new file into place. +- if [ $exit_status -eq 0 ]; then +- ( mv /etc/resolv.conf.dhclient /etc/resolv.conf ) +- exit_status=$? +- fi +- +- if [ $exit_status -ne 0 ]; then +- $LOGGER "Error while writing new /etc/resolv.conf." +- fi ++ if [ "x$new_domain_search" != x ]; then ++ conf="${conf}search ${new_domain_search}\n" ++ elif [ "x$new_domain_name" != x ]; then ++ # Note that the DHCP 'Domain Name Option' is really just a domain ++ # name, and that this practice of using the domain name option as ++ # a search path is both nonstandard and deprecated. ++ conf="${conf}search ${new_domain_name}\n" + fi ++ for nameserver in $new_domain_name_servers; do ++ conf="${conf}nameserver ${nameserver}\n" ++ done + elif [ "x${new_dhcp6_name_servers}" != x ] ; then +- ( cat /dev/null > /etc/resolv.conf.dhclient6 ) +- exit_status=$? +- if [ $exit_status -ne 0 ] ; then +- $LOGGER "Unable to create /etc/resolv.conf.dhclient6: Error $exit_status" +- else +- if [ "x${new_dhcp6_domain_search}" != x ] ; then +- ( echo search ${new_dhcp6_domain_search} >> /etc/resolv.conf.dhclient6 ) +- exit_status=$? +- fi +- for nameserver in ${new_dhcp6_name_servers} ; do +- if [ $exit_status -ne 0 ] ; then +- break +- fi +- ( echo nameserver ${nameserver} >> /etc/resolv.conf.dhclient6 ) +- exit_status=$? +- done +- +- if [ $exit_status -eq 0 ] ; then +- ( mv /etc/resolv.conf.dhclient6 /etc/resolv.conf ) +- exit_status=$? +- fi ++ if [ "x${new_dhcp6_domain_search}" != x ] ; then ++ conf="${conf}search ${new_dhcp6_domain_search}\n" ++ fi ++ for nameserver in ${new_dhcp6_name_servers} ; do ++ conf="${conf}nameserver ${nameserver}\n" ++ done ++ fi + +- if [ $exit_status -ne 0 ] ; then +- $LOGGER "Error while writing new /etc/resolv.conf." +- fi ++ if [ x"$conf" != x ]; then ++ conf="# Generated by dhclient or interface $interface\n${conf}" ++ if type resolvconf >/dev/null 2>&1; then ++ printf "${conf}" | resolvconf -a $interface ++ else ++ printf "${conf}" > /etc/resolv.conf ++ chmod 644 /etc/resolv.conf + fi + fi ++ + # If we're making confs, may as well make an ntp.conf too + make_ntp_conf + } +--- a/client/scripts/linux ++++ b/client/scripts/linux +@@ -26,35 +26,41 @@ + ip=/sbin/ip + + make_resolv_conf() { ++ if [ x"$PEER_DNS" != x ] && [ x$"PEER_DNS" != xyes ]; then ++ return 0 ++ fi ++ local conf= + if [ x"$new_domain_name_servers" != x ]; then +- cat /dev/null > /etc/resolv.conf.dhclient +- chmod 644 /etc/resolv.conf.dhclient +- if [ x"$new_domain_search" != x ]; then +- echo search $new_domain_search >> /etc/resolv.conf.dhclient +- elif [ x"$new_domain_name" != x ]; then ++ if [ "x$new_domain_search" != x ]; then ++ conf="${conf}search ${new_domain_search}\n" ++ elif [ "x$new_domain_name" != x ]; then + # Note that the DHCP 'Domain Name Option' is really just a domain + # name, and that this practice of using the domain name option as + # a search path is both nonstandard and deprecated. +- echo search $new_domain_name >> /etc/resolv.conf.dhclient ++ conf="${conf}search ${new_domain_name}\n" + fi + for nameserver in $new_domain_name_servers; do +- echo nameserver $nameserver >>/etc/resolv.conf.dhclient ++ conf="${conf}nameserver ${nameserver}\n" + done +- +- mv /etc/resolv.conf.dhclient /etc/resolv.conf + elif [ "x${new_dhcp6_name_servers}" != x ] ; then +- cat /dev/null > /etc/resolv.conf.dhclient6 +- chmod 644 /etc/resolv.conf.dhclient6 +- + if [ "x${new_dhcp6_domain_search}" != x ] ; then +- echo search ${new_dhcp6_domain_search} >> /etc/resolv.conf.dhclient6 ++ conf="${conf}search ${new_dhcp6_domain_search}\n" + fi + for nameserver in ${new_dhcp6_name_servers} ; do +- echo nameserver ${nameserver} >> /etc/resolv.conf.dhclient6 ++ conf="${conf}nameserver ${nameserver}\n" + done ++ fi + +- mv /etc/resolv.conf.dhclient6 /etc/resolv.conf ++ if [ x"$conf" != x ]; then ++ conf="# Generated by dhclient or interface $interface\n${conf}" ++ if type resolvconf >/dev/null 2>&1; then ++ printf "${conf}" | resolvconf -a $interface ++ else ++ printf "${conf}" > /etc/resolv.conf ++ chmod 644 /etc/resolv.conf ++ fi + fi ++ + # If we're making confs, may as well make an ntp.conf too + make_ntp_conf + } +--- a/client/scripts/netbsd ++++ b/client/scripts/netbsd +@@ -1,34 +1,41 @@ + #!/bin/sh + + make_resolv_conf() { +- if [ "x$new_domain_name" != x ] && [ x"$new_domain_name_servers" != x ]; then +- cat /dev/null > /etc/resolv.conf.dhclient +- if [ "x$new_domain_search" != x ]; then +- echo search $new_domain_search >> /etc/resolv.conf.dhclient +- elif [ "x$new_domain_name" != x ]; then ++ if [ x"$PEER_DNS" != x ] && [ x$"PEER_DNS" != xyes ]; then ++ return 0 ++ fi ++ local conf= ++ if [ x"$new_domain_name_servers" != x ]; then ++ if [ "x$new_domain_search" != x ]; then ++ conf="${conf}search ${new_domain_search}\n" ++ elif [ "x$new_domain_name" != x ]; then + # Note that the DHCP 'Domain Name Option' is really just a domain + # name, and that this practice of using the domain name option as + # a search path is both nonstandard and deprecated. +- echo search $new_domain_name >> /etc/resolv.conf.dhclient ++ conf="${conf}search ${new_domain_name}\n" + fi + for nameserver in $new_domain_name_servers; do +- echo nameserver $nameserver >>/etc/resolv.conf.dhclient ++ conf="${conf}nameserver ${nameserver}\n" + done +- +- mv /etc/resolv.conf.dhclient /etc/resolv.conf + elif [ "x${new_dhcp6_name_servers}" != x ] ; then +- cat /dev/null > /etc/resolv.conf.dhclient6 +- chmod 644 /etc/resolv.conf.dhclient6 +- + if [ "x${new_dhcp6_domain_search}" != x ] ; then +- echo search ${new_dhcp6_domain_search} >> /etc/resolv.conf.dhclient6 ++ conf="${conf}search ${new_dhcp6_domain_search}\n" + fi + for nameserver in ${new_dhcp6_name_servers} ; do +- echo nameserver ${nameserver} >> /etc/resolv.conf.dhclient6 ++ conf="${conf}nameserver ${nameserver}\n" + done ++ fi + +- mv /etc/resolv.conf.dhclient6 /etc/resolv.conf ++ if [ x"$conf" != x ]; then ++ conf="# Generated by dhclient or interface $interface\n${conf}" ++ if type resolvconf >/dev/null 2>&1; then ++ printf "${conf}" | resolvconf -a $interface ++ else ++ printf "${conf}" > /etc/resolv.conf ++ chmod 644 /etc/resolv.conf ++ fi + fi ++ + # If we're making confs, may as well make an ntp.conf too + make_ntp_conf + } +--- a/client/scripts/openbsd ++++ b/client/scripts/openbsd +@@ -1,34 +1,41 @@ + #!/bin/sh + + make_resolv_conf() { +- if x"$new_domain_name_servers" != x ]; then +- cat /dev/null > /etc/resolv.conf.dhclient +- if [ x"$new_domain_search" != x ]; then +- echo search $new_domain_search >> /etc/resolv.conf.dhclient +- elif [ x"$new_domain_name" != x ]; then ++ if [ x"$PEER_DNS" != x ] && [ x$"PEER_DNS" != xyes ]; then ++ return 0 ++ fi ++ local conf= ++ if [ x"$new_domain_name_servers" != x ]; then ++ if [ "x$new_domain_search" != x ]; then ++ conf="${conf}search ${new_domain_search}\n" ++ elif [ "x$new_domain_name" != x ]; then + # Note that the DHCP 'Domain Name Option' is really just a domain + # name, and that this practice of using the domain name option as + # a search path is both nonstandard and deprecated. +- echo search $new_domain_name >> /etc/resolv.conf.dhclient ++ conf="${conf}search ${new_domain_name}\n" + fi + for nameserver in $new_domain_name_servers; do +- echo nameserver $nameserver >>/etc/resolv.conf.dhclient ++ conf="${conf}nameserver ${nameserver}\n" + done +- +- mv /etc/ersolv.conf.dhclient /etc/resolv.conf + elif [ "x${new_dhcp6_name_servers}" != x ] ; then +- cat /dev/null > /etc/resolv.conf.dhclient6 +- chmod 644 /etc/resolv.conf.dhclient6 +- + if [ "x${new_dhcp6_domain_search}" != x ] ; then +- echo search ${new_dhcp6_domain_search} >> /etc/resolv.conf.dhclient6 ++ conf="${conf}search ${new_dhcp6_domain_search}\n" + fi + for nameserver in ${new_dhcp6_name_servers} ; do +- echo nameserver ${nameserver} >> /etc/resolv.conf.dhclient6 ++ conf="${conf}nameserver ${nameserver}\n" + done ++ fi + +- mv /etc/resolv.conf.dhclient6 /etc/resolv.conf ++ if [ x"$conf" != x ]; then ++ conf="# Generated by dhclient or interface $interface\n${conf}" ++ if type resolvconf >/dev/null 2>&1; then ++ printf "${conf}" | resolvconf -a $interface ++ else ++ printf "${conf}" > /etc/resolv.conf ++ chmod 644 /etc/resolv.conf ++ fi + fi ++ + # If we're making confs, may as well make an ntp.conf too + make_ntp_conf + } +--- a/client/scripts/solaris ++++ b/client/scripts/solaris +@@ -1,22 +1,41 @@ + #!/bin/sh + + make_resolv_conf() { ++ if [ x"$PEER_DNS" != x ] && [ x$"PEER_DNS" != xyes ]; then ++ return 0 ++ fi ++ local conf= + if [ x"$new_domain_name_servers" != x ]; then +- cat /dev/null > /etc/resolv.conf.dhclient +- if [ x"$new_domain_search" != x ]; then +- echo search $new_domain_search >> /etc/resolv.conf.dhclient +- elif [ x"$new_domain_name" != x ]; then ++ if [ "x$new_domain_search" != x ]; then ++ conf="${conf}search ${new_domain_search}\n" ++ elif [ "x$new_domain_name" != x ]; then + # Note that the DHCP 'Domain Name Option' is really just a domain + # name, and that this practice of using the domain name option as + # a search path is both nonstandard and deprecated. +- echo search $new_domain_name >> /etc/resolv.conf.dhclient ++ conf="${conf}search ${new_domain_name}\n" + fi + for nameserver in $new_domain_name_servers; do +- echo nameserver $nameserver >>/etc/resolv.conf.dhclient ++ conf="${conf}nameserver ${nameserver}\n" ++ done ++ elif [ "x${new_dhcp6_name_servers}" != x ] ; then ++ if [ "x${new_dhcp6_domain_search}" != x ] ; then ++ conf="${conf}search ${new_dhcp6_domain_search}\n" ++ fi ++ for nameserver in ${new_dhcp6_name_servers} ; do ++ conf="${conf}nameserver ${nameserver}\n" + done ++ fi + +- mv /etc/resolv.conf.dhclient /etc/resolv.conf ++ if [ x"$conf" != x ]; then ++ conf="# Generated by dhclient or interface $interface\n${conf}" ++ if type resolvconf >/dev/null 2>&1; then ++ printf "${conf}" | resolvconf -a $interface ++ else ++ printf "${conf}" > /etc/resolv.conf ++ chmod 644 /etc/resolv.conf ++ fi + fi ++ + # If we're making confs, may as well make an ntp.conf too + make_ntp_conf + } diff --git a/net-misc/dhcp/files/dhcp-4.2.1-nogateway.patch b/net-misc/dhcp/files/dhcp-4.2.1-nogateway.patch new file mode 100644 index 000000000000..11aaacefd476 --- /dev/null +++ b/net-misc/dhcp/files/dhcp-4.2.1-nogateway.patch @@ -0,0 +1,46 @@ +http://bugs.gentoo.org/265531 + +--- dhcp-4.2.1/client/scripts/linux ++++ dhcp-4.2.1/client/scripts/linux +@@ -193,12 +193,14 @@ + ifconfig $interface inet $new_ip_address $new_subnet_arg \ + $new_broadcast_arg $mtu_arg + # Add a network route to the computed network address. +- for router in $new_routers; do +- if [ "x$new_subnet_mask" = "x255.255.255.255" ] ; then +- route add -host $router dev $interface +- fi +- route add default gw $router $metric_arg dev $interface +- done ++ if [ x$PEER_ROUTERS = x ] || [ x$PEER_ROUTERS = xyes ]; then ++ for router in $new_routers; do ++ if [ "x$new_subnet_mask" = "x255.255.255.255" ] ; then ++ route add -host $router dev $interface ++ fi ++ route add default gw $router $metric_arg dev $interface ++ done ++ fi + fi + if [ x$new_ip_address != x$alias_ip_address ] && [ x$alias_ip_address != x ]; + then +@@ -244,12 +246,14 @@ + ifconfig $interface:0 inet $alias_ip_address $alias_subnet_arg + route add -host $alias_ip_address dev $interface:0 + fi +- for router in $new_routers; do +- if [ "x$new_subnet_mask" = "x255.255.255.255" ] ; then +- route add -host $router dev $interface +- fi +- route add default gw $router $metric_arg dev $interface +- done ++ if [ x$PEER_ROUTERS = x ] || [ x$PEER_ROUTERS = xyes ]; then ++ for router in $new_routers; do ++ if [ "x$new_subnet_mask" = "x255.255.255.255" ] ; then ++ route add -host $router dev $interface ++ fi ++ route add default gw $router $metric_arg dev $interface ++ done ++ fi + make_resolv_conf + exit_with_hooks 0 + fi diff --git a/net-misc/dhcp/files/dhcpd.init3 b/net-misc/dhcp/files/dhcpd.init3 new file mode 100755 index 000000000000..3b00531429a0 --- /dev/null +++ b/net-misc/dhcp/files/dhcpd.init3 @@ -0,0 +1,94 @@ +#!/sbin/runscript +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-misc/dhcp/files/dhcpd.init3,v 1.1 2011/03/05 23:59:20 vapier Exp $ + +opts="configtest" + +DHCPD_CONF=${DHCPD_CONF:-/etc/dhcp/${SVCNAME}.conf} + +depend() { + need net + use logger dns +} + +get_var() { + sed -n 's/^[[:blank:]]\?'"$1"' "*\([^#";]\+\).*/\1/p' \ + "${DHCPD_CHROOT}/${DHCPD_CONF}" +} + +checkconfig() { + dhcpd ${DHCPD_OPTS} ${DHCPD_CHROOT:+-chroot} ${DHCPD_CHROOT} -t 1>/dev/null 2>&1 + local ret=$? + if [ $ret -ne 0 ] ; then + eerror "${SVCNAME} has detected a syntax error in your configuration files:" + dhcpd ${DHCPD_OPTS} ${DHCPD_CHROOT:+-chroot} ${DHCPD_CHROOT} -t + fi + + return $ret +} + +configtest() { + ebegin "Checking ${SVCNAME} configuration" + checkconfig + eend $? +} + +start() { + # Work out our cffile if it's in our DHCPD_OPTS + case " ${DHCPD_OPTS} " in + *" -cf "*) + DHCPD_CONF=" ${DHCPD_OPTS} " + DHCPD_CONF="${DHCPD_CONF##* -cf }" + DHCPD_CONF="${DHCPD_CONF%% *}" + ;; + *) DHCPD_OPTS="${DHCPD_OPTS} -cf ${DHCPD_CONF}" + ;; + esac + + if [ ! -f "${DHCPD_CHROOT}/${DHCPD_CONF}" ] ; then + eerror "${DHCPD_CHROOT}/${DHCPD_CONF} does not exist" + return 1 + fi + + checkconfig || return 1 + + checkpath -d -o dhcp:dhcp /var/run/dhcp /var/lib/dhcp + + local leasefile="$(get_var lease-file-name)" + leasefile="${leasefile:-/var/lib/dhcp/${SVCNAME}.leases}" + if [ ! -f "${DHCPD_CHROOT}${leasefile}" ] ; then + ebegin "Creating ${leasefile}" + touch "${DHCPD_CHROOT}${leasefile}" + chown dhcp:dhcp "${DHCPD_CHROOT}${leasefile}" + eend $? || return 1 + fi + + # Setup LD_PRELOAD so name resolution works in our chroot. + if [ -n "${DHCPD_CHROOT}" ] ; then + LD_PRELOAD="${LD_PRELOAD} /usr/lib/libresolv.so" + export LD_PRELOAD="${LD_PRELOAD} /usr/lib/libnss_dns.so" + fi + + local pidfile="$(get_var pid-file-name)" + pidfile="${pidfile:-/var/run/dhcp/${SVCNAME}.pid}" + + ebegin "Starting ${DHCPD_CHROOT:+chrooted }${SVCNAME}" + start-stop-daemon --start --exec /usr/sbin/dhcpd \ + --pidfile "${DHCPD_CHROOT}/${pidfile}" \ + -- ${DHCPD_OPTS} -q -pf "${pidfile}" -lf "${leasefile}" \ + -user dhcp -group dhcp \ + ${DHCPD_CHROOT:+-chroot} ${DHCPD_CHROOT} ${DHCPD_IFACE} + eend $? \ + && save_options chroot "${DHCPD_CHROOT}" \ + && save_options pidfile "${pidfile}" +} + +stop() { + local chroot="$(get_options chroot)" + + ebegin "Stopping ${chroot:+chrooted }${SVCNAME}" + start-stop-daemon --stop --exec /usr/sbin/dhcpd \ + --pidfile "${chroot}/$(get_options pidfile)" + eend $? +} diff --git a/net-misc/dhcp/files/dhcrelay.init2 b/net-misc/dhcp/files/dhcrelay.init2 new file mode 100755 index 000000000000..08cfb594b831 --- /dev/null +++ b/net-misc/dhcp/files/dhcrelay.init2 @@ -0,0 +1,29 @@ +#!/sbin/runscript +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-misc/dhcp/files/dhcrelay.init2,v 1.1 2011/03/05 23:59:20 vapier Exp $ + +depend() { + need net + use logger +} + +start() { + if [ -z "${DHCRELAY_SERVERS}" ]; then + eerror "No DHCRELAY_SERVERS specified in /etc/conf.d/dhcrelay" + return 1 + fi + + checkpath -d /var/run/dhcp + + ebegin "Starting dhcrelay" + start-stop-daemon --start --exec /usr/sbin/dhcrelay \ + -- -q $(printf -- '-i %s ' ${IFACES}) ${DHCRELAY_OPTS} ${DHCRELAY_SERVERS} + eend $? +} + +stop() { + ebegin "Stopping dhcrelay" + start-stop-daemon --stop --pidfile /var/run/dhcp/dhcrelay.pid + eend $? +} |