From patchwork Mon Nov 23 13:58:15 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Kehn X-Patchwork-Id: 547551 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ozlabs.org (Postfix) with ESMTP id 811ED1402A0 for ; Tue, 24 Nov 2015 00:58:44 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=yahoo.com header.i=@yahoo.com header.b=qUG4ZbWb; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 999F395DC9; Mon, 23 Nov 2015 13:58:43 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id bSM0GaMR1E2l; Mon, 23 Nov 2015 13:58:42 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 2A76E95DB4; Mon, 23 Nov 2015 13:58:42 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 04A4C1C107C for ; Mon, 23 Nov 2015 13:58:41 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id BF214816DE for ; Mon, 23 Nov 2015 13:58:40 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id LstaRYDL7PkO for ; Mon, 23 Nov 2015 13:58:39 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from nm27-vm3.bullet.mail.ne1.yahoo.com (nm27-vm3.bullet.mail.ne1.yahoo.com [98.138.91.157]) by whitealder.osuosl.org (Postfix) with ESMTPS id EECB892825 for ; Mon, 23 Nov 2015 13:58:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1448287118; bh=iTLLx3Hvcxz06v21JAu0UQIylUgS9aV/xOFWQu54/oU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From:Subject; b=qUG4ZbWbAHpHFxHNyHpdbsRYytI0KAJg4YIsozfJCqvs/M0wPVSQsTXWy7w4r1Yhgqb0KV4LT2IdpJpYMnv3s1DiBsaWU5SH3LAjbkIguHtISe3U+5hIgGSy+312vPino3Hc+ADziljduRZ2SXNNn08dzwa5RBKeU2R/NwFHAkKkVOY5nk8oYapki1yyc7egnQNYSCY2jJ+xAMF3RnjkPIzL1RGXBilwm51MjLveDZcUleg4q9TVrLr1EvF3QnvI8Zj8niNamtFHxJKilsb1PeBrWO+WqL+7+kH+lhDHexA+1DtHY/sAuUxXHjDwaJGKB+pLATqhn33miFoEgTvQIw== Received: from [98.138.100.116] by nm27.bullet.mail.ne1.yahoo.com with NNFMP; 23 Nov 2015 13:58:38 -0000 Received: from [98.138.84.43] by tm107.bullet.mail.ne1.yahoo.com with NNFMP; 23 Nov 2015 13:58:38 -0000 Received: from [127.0.0.1] by smtp111.mail.ne1.yahoo.com with NNFMP; 23 Nov 2015 13:58:38 -0000 X-Yahoo-Newman-Id: 227336.49445.bm@smtp111.mail.ne1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: k2yv8.kVM1mORY0QY4Ae75dixUPJU2QHXMbEqojgye2Spin gHVyHD_QXA0urVUjdjhekaxSQGWdLWIa9C5bFBKMQNvbv_QuInUbBjHmFhTc zbBHCJdRa2uRVTsEmIL8gQPFzTNA3eLPnSXM3qYIN6GC3k6w4hCczEzkXiiW P_DfYO3CCic6ruhsFDnH9iemYMkLHUdSmQ7dHZVe1s8BtGIb2Pmf4YkTSRKO 8NfJlOvdJ9PLqbq_IZXOH5Osvh3NGkEOMB0VA5.9.RkBpzOXo6sf_XBmdf3W BWwrQ_ioxAImMANpQn7qHYXvTWcwiO5ST3AMXYwCSue_MpbmNqBeR56BDx3u sfcB7vXqZVPbzYiv06U81nhXHJeaar2TafeLjCjITory13_uMLWoQJ.eBoBp V1FR92vpZ0FnBEuDg6Y0BDdP8hzzqzpyNDVD_snv7eAhgYZI6hqkSQvDVY5g fLxL0FVTKqb4sKDWPPB3l6nNjL5.HWf_00o9AY6aES8CxoyS5bgaylsafVLm sujE8dOfJ6PEPmVf98nH6UWXHr4jd X-Yahoo-SMTP: tVp.douswBADms9I1_pvnFcs0w-- From: Doug Kehn To: buildroot@buildroot.org Date: Mon, 23 Nov 2015 07:58:15 -0600 Message-Id: <1448287096-18606-2-git-send-email-rdkehn@yahoo.com> X-Mailer: git-send-email 2.6.2 In-Reply-To: <1448287096-18606-1-git-send-email-rdkehn@yahoo.com> References: <1448287096-18606-1-git-send-email-rdkehn@yahoo.com> Cc: "Yann E . MORIN" Subject: [Buildroot] [PATCH v5 1/2] package/unscd: new package X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" A daemon which handles passwd, group and host lookups for running programs and caches the results for the next query. You only need this package if you are using slow Name Services like LDAP, NIS or NIS+. This particular NSCD is a complete rewrite of the GNU glibc nscd which is a single threaded server process which offloads all NSS lookups to worker children; cache hits are handled by the parent, and only cache misses start worker children, making the parent immune to resource leaks, hangs, and crashes in NSS libraries. It should mostly be a drop-in replacement for existing installs using nscd. Signed-off-by: Doug Kehn Cc: Yann E. MORIN CC: Arnout Vandecappelle --- Changes v4 -> v5 - Reincorporate $(APPLY_PATCHES) suggestion after update by Arnout. Changes v3 -> v4 - Incorporate feedback/suggestions by Yann and Maxime. Changes v2 -> v3 - Remove trailing '/' from UNSCD_SITE. - Whitespace cleanup. Changes v1 -> v2 - Incorporate feedback/suggestions by Yann (from nss-pam-ldapd patch). --- package/Config.in | 1 + package/unscd/Config.in | 11 +++++++++++ package/unscd/S46unscd | 24 ++++++++++++++++++++++++ package/unscd/unscd.hash | 3 +++ package/unscd/unscd.mk | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 86 insertions(+) create mode 100644 package/unscd/Config.in create mode 100644 package/unscd/S46unscd create mode 100644 package/unscd/unscd.hash create mode 100644 package/unscd/unscd.mk diff --git a/package/Config.in b/package/Config.in index bdc3063..7fd3f0d 100644 --- a/package/Config.in +++ b/package/Config.in @@ -1534,6 +1534,7 @@ if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS source "package/sysvinit/Config.in" source "package/tar/Config.in" endif + source "package/unscd/Config.in" source "package/util-linux/Config.in" endmenu diff --git a/package/unscd/Config.in b/package/unscd/Config.in new file mode 100644 index 0000000..1639bca --- /dev/null +++ b/package/unscd/Config.in @@ -0,0 +1,11 @@ +config BR2_PACKAGE_UNSCD + bool "unscd" + depends on BR2_TOOLCHAIN_USES_GLIBC + depends on !BR2_GLIBC_NSCD + help + Micro Name Service Caching Daemon + + https://packages.debian.org/unscd + +comment "unscd needs an (e)glibc toolchain" + depends on !BR2_TOOLCHAIN_USES_GLIBC diff --git a/package/unscd/S46unscd b/package/unscd/S46unscd new file mode 100644 index 0000000..7d18f94 --- /dev/null +++ b/package/unscd/S46unscd @@ -0,0 +1,24 @@ +#!/bin/sh + +NAME="nscd" +DAEMON="/usr/sbin/${NAME}" + +case "$1" in +start) + printf "Starting ${NAME}: " + start-stop-daemon -S -x ${DAEMON} + [ $? -eq 0 ] && echo "OK" || echo "FAIL" + ;; +stop) + printf "Stopping ${NAME}: " + start-stop-daemon -K -x ${DAEMON} + [ $? -eq 0 ] && echo "OK" || echo "FAIL" + ;; +restart|reload) + $0 stop + $0 start + ;; +*) + echo "Usage: $0 {start|stop|restart|reload}" + exit 1 +esac diff --git a/package/unscd/unscd.hash b/package/unscd/unscd.hash new file mode 100644 index 0000000..f65ebda --- /dev/null +++ b/package/unscd/unscd.hash @@ -0,0 +1,3 @@ +# From http://snapshot.debian.org/archive/debian/20150519T094547Z/pool/main/u/unscd/unscd_0.51-1.dsc +sha256 0dbf717726e1c29af8f4ef7d2d2695e5eedb342320a730a56ae0d56fe32891f8 unscd_0.51.orig.tar.gz +sha256 8ae16a826afd464639f6c6372fabafee5b93aea9645b3fbf23970296d4961f27 unscd_0.51-1.debian.tar.gz diff --git a/package/unscd/unscd.mk b/package/unscd/unscd.mk new file mode 100644 index 0000000..1ea8d5c --- /dev/null +++ b/package/unscd/unscd.mk @@ -0,0 +1,47 @@ +################################################################################ +# +# unscd +# +################################################################################ + +UNSCD_VERSION = 0.51 +UNSCD_SOURCE = unscd_$(UNSCD_VERSION).orig.tar.gz +UNSCD_SITE = http://snapshot.debian.org/archive/debian/20150519T094547Z/pool/main/u/unscd +UNSCD_EXTRA_DOWNLOADS = unscd_$(UNSCD_VERSION)-1.debian.tar.gz +UNSCD_LICENSE = GPLv2 +UNSCD_LICENSE_FILES = debian/copyright + +define UNSCD_EXTRACT_DEBIAN + $(call suitable-extractor,$(UNSCD_EXTRA_DOWNLOADS)) \ + $(DL_DIR)/$(UNSCD_EXTRA_DOWNLOADS) \ + | $(TAR) -C $(@D) -xf - +endef + +UNSCD_POST_EXTRACT_HOOKS += UNSCD_EXTRACT_DEBIAN + +define UNSCD_APPLY_DEBIAN_PATCHES + $(APPLY_PATCHES) $(@D) $(@D)/debian/patches +endef + +UNSCD_POST_PATCH_HOOKS += UNSCD_APPLY_DEBIAN_PATCHES + +define UNSCD_BUILD_CMDS + $(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_LDFLAGS) \ + $(@D)/nscd.c -o $(@D)/nscd +endef + +define UNSCD_INSTALL_TARGET_CMDS + $(INSTALL) -m 755 -D $(@D)/nscd $(TARGET_DIR)/usr/sbin/nscd + $(INSTALL) -m 600 -D $(@D)/debian/nscd.conf $(TARGET_DIR)/etc/nscd.conf +endef + +define UNSCD_INSTALL_INIT_SYSV + $(INSTALL) -m 755 -D package/unscd/S46unscd \ + $(TARGET_DIR)/etc/init.d/S46unscd +endef + +define UNSCD_USERS + unscd -1 unscd -1 * - - - unscd user +endef + +$(eval $(generic-package))