]> git.donarmstrong.com Git - unscd.git/commitdiff
Merge tag 'upstream/0.49'
authorDon Armstrong <don@donarmstrong.com>
Mon, 21 Oct 2013 22:03:16 +0000 (15:03 -0700)
committerDon Armstrong <don@donarmstrong.com>
Mon, 21 Oct 2013 22:03:16 +0000 (15:03 -0700)
Upstream version 0.49

14 files changed:
debian/NEWS [new file with mode: 0644]
debian/changelog [new file with mode: 0644]
debian/compat [new file with mode: 0644]
debian/control [new file with mode: 0644]
debian/copyright [new file with mode: 0644]
debian/nscd.8 [new file with mode: 0644]
debian/nscd.conf [new file with mode: 0644]
debian/patches/series [new file with mode: 0644]
debian/patches/silence_cache_invalidation [new file with mode: 0644]
debian/repack [new file with mode: 0644]
debian/rules [new file with mode: 0755]
debian/source/format [new file with mode: 0644]
debian/unscd.init [new file with mode: 0644]
debian/watch [new file with mode: 0644]

diff --git a/debian/NEWS b/debian/NEWS
new file mode 100644 (file)
index 0000000..90268cf
--- /dev/null
@@ -0,0 +1,9 @@
+unscd (0.47-2) unstable; urgency=low
+
+  * NB: Because insserv is slightly broken (#606593), we cannot provide
+    nscd, as this would break installs which hadn't already purged nscd.
+    However, if you have init scripts which depend on nscd, feel free to
+    change Provides: unscd to Provides: unscd nscd after purging nscd.
+
+ -- Don Armstrong <don@debian.org>  Sun, 12 Dec 2010 20:30:10 -0800
+
diff --git a/debian/changelog b/debian/changelog
new file mode 100644 (file)
index 0000000..9209e4f
--- /dev/null
@@ -0,0 +1,42 @@
+unscd (0.49-1) unstable; urgency=low
+
+  * New upstream release
+
+ -- Don Armstrong <don@debian.org>  Tue, 07 May 2013 11:54:45 -0700
+
+unscd (0.48-2) unstable; urgency=low
+
+  * Actually distribute the nscd binary and configuration file (Closes:
+    #657721) and locate a brown paper bag.
+
+ -- Don Armstrong <don@debian.org>  Sat, 28 Jan 2012 09:27:24 -0800
+
+unscd (0.48-1) unstable; urgency=low
+
+  * New upstream release
+  * Fix typo in nscd.conf (Closes: #656615)
+  * Add newline to nscd.conf (Closes: #656603)
+  * Switch to dh7 style rules file
+  * Update standards version; no changes
+
+ -- Don Armstrong <don@debian.org>  Sat, 21 Jan 2012 13:36:59 -0800
+
+unscd (0.47-3) unstable; urgency=low
+
+  * Only indicate that the cache is being invalidated when in debug mode
+    (Closes: #622230)
+
+ -- Don Armstrong <don@debian.org>  Mon, 30 May 2011 08:56:33 -0700
+
+unscd (0.47-2) unstable; urgency=low
+
+  * Remove the Provides: nscd as a workaround for (Closes: #606588) to
+    avoid issues due to #606593 in insserv.
+
+ -- Don Armstrong <don@debian.org>  Sun, 12 Dec 2010 20:32:11 -0800
+
+unscd (0.47-1) unstable; urgency=low
+
+  * Initial packaging for Debian (Closes: #513305)
+
+ -- Don Armstrong <don@debian.org>  Tue, 19 Oct 2010 22:21:13 -0700
diff --git a/debian/compat b/debian/compat
new file mode 100644 (file)
index 0000000..7ed6ff8
--- /dev/null
@@ -0,0 +1 @@
+5
diff --git a/debian/control b/debian/control
new file mode 100644 (file)
index 0000000..4473753
--- /dev/null
@@ -0,0 +1,31 @@
+Source: unscd
+Section: admin
+Priority: extra
+Standards-Version: 3.9.2
+Build-Depends: debhelper (>= 7.0.50~), groff-base
+Maintainer: Don Armstrong <don@debian.org>
+VCS-Browser: http://websvn.donarmstrong.com/listing.php?repname=deb_pkgs&path=%2Funscd%2Ftrunk%2F
+VCS-Svn: http://svn.donarmstrong.com/deb_pkgs/unscd/trunk/
+
+
+Package: unscd
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Conflicts: nscd
+Replaces: nscd
+Provides: nscd
+Homepage: http://busybox.net/~vda/unscd/
+Description: Micro Name Service Caching Daemon
+ 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.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644 (file)
index 0000000..a7615c7
--- /dev/null
@@ -0,0 +1,8 @@
+Authors: Denys Vlasenko <vda.linux@googlemail.com>
+Webpage: http://busybox.net/~vda/unscd/
+Download: http://busybox.net/~vda/unscd/
+Debianized: Don Armstrong <don@debian.org> Tuesday, January 27, 2009 16:58:55 PST
+
+Copyright: Copyright (C) 2007 Denys Vlasenko. Licensed under the GPL version 2. 
+
+License: GPL version 2, available at /usr/share/common-licenses/GPL-2
diff --git a/debian/nscd.8 b/debian/nscd.8
new file mode 100644 (file)
index 0000000..dd91f04
--- /dev/null
@@ -0,0 +1,31 @@
+.TH NSCD "8" "October 2010" "unscd - nscd which does not hang" "User Commands"
+.SH NAME
+unscd \- nscd which does not hang
+.SH SYNOPSIS
+.B nscd
+[\fIOPTION\fR...]
+.SH DESCRIPTION
+Name Service Cache Daemon
+.TP
+\fB\-d\fR,\-\-debug
+Do not daemonize; log to stderr
+.HP
+\fB\-f\fR,\-\-config\-file File to read configuration from
+.TP
+\fB\-i\fR,\-\-invalidate
+Invalidate cache
+.TP
+\fB\-K\fR,\-\-shutdown
+Shut the server down
+.TP
+\fB\-t\fR,\-\-nthreads
+Serve N requests in parallel
+.TP
+\fB\-V\fR,\-\-version
+Version
+.SH FILES
+.B /etc/nscd.conf
+.SH AUTHOR
+unscd is written by Denys Vlasenko and is licensed under the GPL version 2.
+.TP
+This manpage was written by Don Armstrong <don@debian.org> with help from help2man and is licensed under the same terms as unscd.
diff --git a/debian/nscd.conf b/debian/nscd.conf
new file mode 100644 (file)
index 0000000..aa35af9
--- /dev/null
@@ -0,0 +1,72 @@
+# This file is currently taken verbatim from the version distributed
+# with GNU glibc's nscd with unused configurations removed
+# 
+# /etc/nscd.conf
+#
+# An example Name Service Cache config file.  This file is needed by nscd.
+#
+# Legal entries are:
+#
+#      logfile                 <file>
+#      debug-level             <level>
+#      threads                 <initial #threads to use>
+#      max-threads             <maximum #threads to use>
+#      server-user             <user to run server as instead of root>
+#              server-user is ignored if nscd is started with -S parameters
+#       stat-user               (ignored; any user can stat)
+#      reload-count            (ignored; unscd should never crash)
+#      paranoia                (ignored)
+#      restart-interval        (ignored; unscd should never crash)
+#
+#       enable-cache           <service> <yes|no>
+#      positive-time-to-live   <service> <time in seconds>
+#      negative-time-to-live   <service> <time in seconds>
+#       suggested-size         <service> <prime number>
+#      check-files             <service> <yes|no>
+#      persistent              <service> (ignored)
+#      shared                  <service> (ignored)
+#      auto-propagate          <service> (ignored)
+#
+# Currently supported cache names (services): passwd, group, hosts
+#
+
+
+#      logfile                 /var/log/nscd.log
+#      threads                 4
+#      max-threads             32
+#      server-user             nobody
+#      stat-user               somebody
+       debug-level             0
+#      reload-count            5
+       paranoia                no
+#      restart-interval        3600
+
+       enable-cache            passwd          yes
+       positive-time-to-live   passwd          600
+       negative-time-to-live   passwd          20
+       suggested-size          passwd          211
+       check-files             passwd          yes
+       persistent              passwd          yes
+       shared                  passwd          yes
+       auto-propagate          passwd          yes
+
+       enable-cache            group           yes
+       positive-time-to-live   group           3600
+       negative-time-to-live   group           60
+       suggested-size          group           211
+       check-files             group           yes
+       persistent              group           yes
+       shared                  group           yes
+       auto-propagate          group           yes
+
+# hosts caching is broken with gethostby* calls, hence is now disabled
+# per default.  See /usr/share/doc/nscd/NEWS.Debian.
+       enable-cache            hosts           no
+       positive-time-to-live   hosts           3600
+       negative-time-to-live   hosts           20
+       suggested-size          hosts           211
+       check-files             hosts           yes
+       persistent              hosts           yes
+       shared                  hosts           yes
+
+# unscd does not support services caching
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644 (file)
index 0000000..9d5b3aa
--- /dev/null
@@ -0,0 +1 @@
+silence_cache_invalidation
diff --git a/debian/patches/silence_cache_invalidation b/debian/patches/silence_cache_invalidation
new file mode 100644 (file)
index 0000000..4df8ba7
--- /dev/null
@@ -0,0 +1,19 @@
+From: Don Armstrong <don@debian.org>
+Subject: Silence cache invalidation requests unless in debug mode
+Origin: debian, http://websvn.donarmstrong.com/filedetails.php?repname=deb_pkgs&path=%2Funscd%2Ftrunk%2Fdebian%2Fpatches%2Fsilence_cache_invalidation
+Bug-Debian: http://bugs.debian.org/622230
+Index: unscd/nscd.c
+===================================================================
+--- unscd.orig/nscd.c  2012-01-21 16:05:03.000000000 -0800
++++ unscd/nscd.c       2012-01-21 16:05:33.000000000 -0800
+@@ -2391,7 +2391,9 @@
+               reqdata.req.key_len = arg_len;
+               memcpy(reqdata.arg, arg, arg_len);
+               xfull_write(sock, &reqdata, arg_len + sizeof(ureq));
+-              printf("sent invalidate(%s) request, exiting\n", arg);
++              if (debug) {
++                printf("sent invalidate(%s) request, exiting\n", arg);
++              }
+       }
+       exit(0);
+ }
diff --git a/debian/repack b/debian/repack
new file mode 100644 (file)
index 0000000..6c29dde
--- /dev/null
@@ -0,0 +1,84 @@
+#!/usr/bin/perl
+# repack repacks unscd upstream tarball
+# and is released under the terms of the GNU GPL version 3, or any
+# later version, at your option. See the file README and COPYING for
+# more information.
+# Copyright 2013 by Don Armstrong <don@donarmstrong.com>.
+
+
+use warnings;
+use strict;
+
+use Getopt::Long;
+use Pod::Usage;
+
+=head1 NAME
+
+repack - repacks unscd upstream tarball
+
+=head1 SYNOPSIS
+
+repack --upstream-version version filename
+
+ Options:
+
+=head1 OPTIONS
+
+=over
+
+=item B<--upstream-version>
+
+Upstream version
+
+=back
+
+=head1 EXAMPLES
+
+repack --upstream-version 0.48 nscd-0.48.c
+
+=cut
+
+use vars qw($DEBUG);
+
+use Cwd;
+use File::Temp qw(tempdir);
+
+my %options = (debug           => 0,
+               help            => 0,
+               man             => 0,
+              );
+
+GetOptions(\%options,
+           'upstream_version|upstream-version=s',
+          );
+
+$DEBUG = $options{debug};
+
+my @USAGE_ERRORS;
+if (not exists $options{upstream_version}) {
+     push @USAGE_ERRORS,"You must give the  --upstream-version option";
+}
+if (@ARGV!=1) {
+     push @USAGE_ERRORS,"You must give exactly one filename on the command line";
+}
+
+
+pod2usage(join("\n",@USAGE_ERRORS)) if @USAGE_ERRORS;
+
+
+my $tdir = tempdir(CLEANUP => 1);
+my $curdir = getcwd;
+
+my $orig_dir_name = 'unscd-'.$options{upstream_version};
+my $orig_dir_path = File::Spec->catfile($tdir,$orig_dir_name);
+mkdir($orig_dir_path) or die "Unable to mkdir $orig_dir_path: $!";
+rename($ARGV[0],File::Spec->catfile($orig_dir_path,'nscd.c')) or
+    die "Unable to copy $ARGV[0] to $orig_dir_path/nscd.c: $!";
+system('tar','-zcf',File::Spec->catfile($curdir,
+                                        File::Spec->updir(),
+                                        'unscd_'.$options{upstream_version}.'.orig.tar.gz'),
+       '-C',$tdir,$orig_dir_name) == 0 or
+    die "Tar failed";
+
+__END__
+
diff --git a/debian/rules b/debian/rules
new file mode 100755 (executable)
index 0000000..ca4fcbd
--- /dev/null
@@ -0,0 +1,13 @@
+#!/usr/bin/make -f
+
+%:
+       dh $@
+
+override_dh_auto_build:
+       gcc $(CFLAGS) $(LDFLAGS) -o nscd nscd.c
+
+override_dh_auto_install:
+       install -d debian/unscd/usr/sbin/
+       install -t debian/unscd/usr/sbin/ nscd
+       install -d debian/unscd/etc/
+       install -m644 -t debian/unscd/etc/ debian/nscd.conf
diff --git a/debian/source/format b/debian/source/format
new file mode 100644 (file)
index 0000000..163aaf8
--- /dev/null
@@ -0,0 +1 @@
+3.0 (quilt)
diff --git a/debian/unscd.init b/debian/unscd.init
new file mode 100644 (file)
index 0000000..3c14f6c
--- /dev/null
@@ -0,0 +1,135 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides:          unscd
+# Required-Start:    $remote_fs
+# Required-Stop:     $remote_fs
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: Starts the Micro Name Service Cache Daemon
+# Description:  This is a daemon which handles passwd and group lookups
+#              for running programs and caches the results for the next
+#              query.  You should start this daemon only if you use
+#              slow Services like NIS or NIS+
+### END INIT INFO
+
+# NB: Because insserv is slightly broken (#606593), we cannot provide
+# nscd, as this would break installs which hadn't already purged nscd.
+# However, if you have init scripts which depend on nscd, feel free to
+# change Provides: unscd to Provides: unscd nscd after purging nscd.
+
+#
+# unscd:       Starts the Micro Name Service Cache Daemon
+#
+# description:  This is a daemon which handles passwd and group lookups
+#              for running programs and caches the results for the next
+#              query.  You should start this daemon only if you use
+#              slow Services like NIS or NIS+
+
+# Sanity checks.
+
+NAME="unscd"
+DESC="Micro Name Service Cache Daemon"
+DAEMON="/usr/sbin/nscd"
+PIDFILE="/var/run/nscd/nscd.pid"
+
+# Sanity checks.
+umask 022
+[ -f /etc/nscd.conf ] || exit 0
+[ -x "$DAEMON" ] || exit 0
+[ -d /var/run/nscd ] || mkdir -p /var/run/nscd
+. /lib/lsb/init-functions
+
+start_unscd()
+{
+       # Return
+       #   0 if daemon has been started
+       #   1 if daemon was already running
+       #   2 if daemon could not be started
+       start-stop-daemon --start --quiet --pidfile "$PIDFILE" --exec "$DAEMON" --test > /dev/null || return 1
+       start-stop-daemon --start --quiet --pidfile "$PIDFILE" --exec "$DAEMON" || return 2
+}
+
+stop_unscd()
+{
+       # Return
+       #   0 if daemon has been stopped
+       #   1 if daemon was already stopped
+       #   2 if daemon could not be stopped
+
+       # we try to stop using unscd --shutdown, that fails also if unscd is not present.
+       # in that case, fallback to "good old methods"
+       RETVAL=0
+       if ! $DAEMON --shutdown; then
+               start-stop-daemon --stop --quiet --pidfile "$PIDFILE" --name "$NAME" --test > /dev/null
+               RETVAL="$?"
+               [ "$?" -ne 0  -a  "$?" -ne 1 ] && return 2
+       fi
+
+       # Wait for children to finish too
+       start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec "$DAEMON" > /dev/null
+       [ "$?" -ne 0  -a  "$?" -ne 1 ] && return 2
+       rm -f "$PIDFILE"
+       return "$RETVAL"
+}
+
+status()
+{
+       # Return
+       #   0 if daemon is stopped
+       #   1 if daemon is running
+       start-stop-daemon --start --quiet --pidfile "$PIDFILE" --exec "$DAEMON" --test > /dev/null || return 1
+       return 0
+}
+
+case "$1" in
+start)
+       log_daemon_msg "Starting $DESC" "$NAME"
+       start_unscd
+       case "$?" in
+               0) log_end_msg 0 ; exit 0 ;;
+               1) log_warning_msg " (already running)." ; exit 0 ;;
+               *) log_end_msg 1 ; exit 1 ;;
+       esac
+       ;;
+stop)
+       log_daemon_msg "Stopping $DESC" "$NAME"
+       stop_unscd
+       case "$?" in
+               0) log_end_msg 0 ; exit 0 ;;
+               1) log_warning_msg " (not running)." ; exit 0 ;;
+               *) log_end_msg 1 ; exit 1 ;;
+       esac
+       ;;
+restart|force-reload|reload)
+       log_daemon_msg "Restarting $DESC" "$NAME"
+       stop_unscd
+       $DAEMON --invalidate passwd --invalidate group --invalidate hosts
+       case "$?" in
+       0|1)
+               start_unscd
+               case "$?" in
+                       0) log_end_msg 0 ; exit 0 ;;
+                       1) log_failure_msg " (failed -- old process is still running)." ; exit 1 ;;
+                       *) log_failure_msg " (failed to start)." ; exit 1 ;;
+               esac
+               ;;
+       *)
+               log_failure_msg " (failed to stop)."
+               exit 1
+               ;;
+       esac
+       ;;
+status)
+       log_daemon_msg "Status of $DESC service: "
+       status
+       case "$?" in
+               0) log_failure_msg "not running." ; exit 1 ;;
+               1) log_success_msg "running." ; exit 0 ;;
+       esac
+       ;;
+*)
+       echo "Usage: /etc/init.d/$NAME {start|stop|reload|force-reload|restart|status}" >&2
+       exit 1
+       ;;
+esac
+
diff --git a/debian/watch b/debian/watch
new file mode 100644 (file)
index 0000000..cd2191a
--- /dev/null
@@ -0,0 +1,4 @@
+version=3
+http://busybox.net/~vda/unscd/nscd-([\d\.]+).c \
+  debian \
+  perl debian/repack
\ No newline at end of file