Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: rdkehn at yahoo.com <rdkehn@yahoo.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 1/1] package/unscd: new package
Date: Fri, 22 May 2015 17:51:10 -0500	[thread overview]
Message-ID: <20150522225110.GA9679@dkarchlinux64.currentcomm.com> (raw)
In-Reply-To: <1432331921-9417-1-git-send-email-rdkehn@yahoo.com>

Hi Yann,

I will apply your feedback to nss-pam-ldapd to this submission and
re-submit.  Of course, let me know if there is something else
wrong...

Regards,
...doug

On Fri, May 22, 2015 at 04:58:41PM -0500, Doug Kehn wrote:
> 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 <rdkehn@yahoo.com>
> ---
>  package/Config.in        |  1 +
>  package/unscd/Config.in  |  6 ++++++
>  package/unscd/S46unscd   | 31 +++++++++++++++++++++++++++++++
>  package/unscd/unscd.hash |  4 ++++
>  package/unscd/unscd.mk   | 47 +++++++++++++++++++++++++++++++++++++++++++++++
>  5 files changed, 89 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 e0c2e2a..39ef6c4 100644
> --- a/package/Config.in
> +++ b/package/Config.in
> @@ -1420,6 +1420,7 @@ endif
>  if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
>  	source "package/sysvinit/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..c448489
> --- /dev/null
> +++ b/package/unscd/Config.in
> @@ -0,0 +1,6 @@
> +config BR2_PACKAGE_UNSCD
> +	bool "unscd"
> +	depends on BR2_USE_MMU
> +	depends on BR2_TOOLCHAIN_USES_GLIBC
> +	help
> +	  Micro Name Service Caching Daemon
> diff --git a/package/unscd/S46unscd b/package/unscd/S46unscd
> new file mode 100644
> index 0000000..59a1358
> --- /dev/null
> +++ b/package/unscd/S46unscd
> @@ -0,0 +1,31 @@
> +#!/bin/sh
> +
> +NAME="nscd"
> +DAEMON="/usr/sbin/${NAME}"
> +DAEMON_CONF="/etc/${NAME}.conf"
> +
> +[ -x ${DAEMON} ] || exit 0
> +[ -f ${DAEMON_CONF} ] || exit 0
> +
> +case "$1" in
> +start)
> +        echo -n "Starting ${NAME}: "
> +        start-stop-daemon -S -x ${DAEMON}
> +        [ $? -eq 0 ] && echo "OK" || echo "FAIL"
> +        ;;
> +stop)
> +        echo -n "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
> +
> +exit 0
> +
> diff --git a/package/unscd/unscd.hash b/package/unscd/unscd.hash
> new file mode 100644
> index 0000000..173c59f
> --- /dev/null
> +++ b/package/unscd/unscd.hash
> @@ -0,0 +1,4 @@
> +# 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..51da0b1
> --- /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
> +	gzip -d -c $(BR2_DL_DIR)/$(UNSCD_EXTRA_DOWNLOADS) | tar -C $(@D) -xf -
> +endef
> +
> +UNSCD_POST_EXTRACT_HOOKS += UNSCD_EXTRACT_DEBIAN
> +
> +define UNSCD_APPLY_DEBIAN_PATCHES
> +	for f in `grep -Ev "^#" $(@D)/debian/patches/series 2> /dev/null`; do \
> +		cat "$(@D)/debian/patches/$${f}" | patch -g0 -p1 -E -d "$(@D)" -t -N; \
> +	done
> +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))
> -- 
> 2.4.1
> 

      reply	other threads:[~2015-05-22 22:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-22 21:58 [Buildroot] [PATCH 1/1] package/unscd: new package Doug Kehn
2015-05-22 22:51 ` rdkehn at yahoo.com [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150522225110.GA9679@dkarchlinux64.currentcomm.com \
    --to=rdkehn@yahoo.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox