Commit 8164e66c authored by Seblu's avatar Seblu
Browse files

add unscd



git-svn-id: https://seblu.net/s/archpkg@170 02741741-5192-46b8-8916-7152b19231d9
parent 51fa15e1
Loading
Loading
Loading
Loading

unscd/PKGBUILD

0 → 100644
+27 −0
Original line number Diff line number Diff line
# Maintainer: Sebastien Luttringer <seblu+arch@seblu.net>

pkgname=unscd
pkgver=0.47
pkgrel=1
pkgdesc='Drop-in replacement for glibc nscd which is designed for simplicity and stability'
arch=('i686' 'x86_64')
url='http://busybox.net/~vda/unscd/'
license=('GPL2')
source=("http://busybox.net/~vda/unscd/nscd-$pkgver.c"
  'rc.d' 'rc.conf' 'unscd.conf' 'unscd.8')
md5sums=('90af0b57648d2199209051f0d57ba286')

build() {
  sed -i 's,/etc/nscd.conf,/etc/unscd.conf,g' "nscd-$pkgver.c"
  gcc $CFLAGS $LDFLAGS "nscd-$pkgver.c" -o unscd
}

package() {
  install -D -m 755 unscd "$pkgdir/usr/sbin/unscd"
  install -D -m 644 unscd.conf "$pkgdir/etc/unscd.conf"
  install -D -m 644 unscd.8 "$pkgdir/usr/share/man/man8/unscd.8"
  install -D -m 755 rc.d "$pkgdir/etc/rc.d/unscd"
  install -D -m 644 rc.conf "$pkgdir/etc/conf.d/unscd"
}

# vim:set ts=2 sw=2 ft=sh et:

unscd/rc.conf

0 → 100644
+2 −0
Original line number Diff line number Diff line
# Configuration file for unscd
#UNSCD_OPTIONS='-d'

unscd/rc.d

0 → 100644
+40 −0
Original line number Diff line number Diff line
#!/bin/bash

. /etc/rc.conf
. /etc/rc.d/functions
. /etc/conf.d/unscd

BIN=/usr/bin/unscd
PID=$(pidof -o %PPID $BIN)

case "$1" in
  start)
    stat_busy "Starting unscd"
    [[ -z "$PID" ]] && $BIN $UNSCD_OPTIONS
    if (( $? == 0 )); then
      add_daemon unscd
      stat_done
    else
      stat_fail
    fi
    ;;
  stop)
    stat_busy "Stopping unscd"
    [[ ! -z "$PID" ]]  && kill $PID &> /dev/null
    if (( $? == 0 )); then
      rm_daemon unscd
      stat_done
    else
      stat_fail
    fi
    ;;
  restart)
    $0 stop
    sleep 1
    $0 start
    ;;
  *)
    echo "usage: $0 {start|stop|restart}"  
esac
:
# vim:set ts=2 sw=2 ft=sh noet:

unscd/unscd.8

0 → 100644
+31 −0
Original line number Diff line number Diff line
.TH UNSCD "8" "October 2010" "unscd - nscd which does not hang" "User Commands"
.SH NAME
unscd \- nscd which does not hang
.SH SYNOPSIS
.B unscd
[\fIOPTION\fR...]
.SH DESCRIPTION
Micro 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/unscd.conf
.SH AUTHOR
unscd was written by Denys Vlasenko and is licensed under the GPL version 2.
.TP
This manpage was written by Don Armstrong <don@debian.org> and updated to Archlinux by Sebastien Luttringer <seblu+arch@seblu.net>

unscd/unscd.conf

0 → 100644
+71 −0
Original line number Diff line number Diff line
# This file is currently taken verbatim from the version distributed
# with GNU glibc's nscd with unused configurations removed
# 
# /etc/unscd.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)x
#
#       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/unscd.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.
	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