Accepting request 142718 from Base:System

Remove nscd init script, use systemd files. (forwarded request 142717 from a_jaeger)

OBS-URL: https://build.opensuse.org/request/show/142718
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/glibc?expand=0&rev=126
This commit is contained in:
Stephan Kulow 2012-11-26 17:54:44 +00:00 committed by Git OBS Bridge
commit e2b1d0cc0b
4 changed files with 31 additions and 150 deletions

View File

@ -1,8 +1,8 @@
diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
index 1a023f9..c8af8b9 100644
--- a/sysdeps/posix/getaddrinfo.c
+++ b/sysdeps/posix/getaddrinfo.c
@@ -269,7 +269,7 @@ extern service_user *__nss_hosts_database attribute_hidden;
Index: glibc-2.16.90/sysdeps/posix/getaddrinfo.c
===================================================================
--- glibc-2.16.90.orig/sysdeps/posix/getaddrinfo.c 2012-11-20 03:45:45.000000000 +0100
+++ glibc-2.16.90/sysdeps/posix/getaddrinfo.c 2012-11-23 15:32:33.000000000 +0100
@@ -269,7 +269,7 @@ extern service_user *__nss_hosts_databas
static int
gaih_inet (const char *name, const struct gaih_service *service,
const struct addrinfo *req, struct addrinfo **pai,
@ -11,10 +11,10 @@ index 1a023f9..c8af8b9 100644
{
const struct gaih_typeproto *tp = gaih_inet_typeproto;
struct gaih_servtuple *st = (struct gaih_servtuple *) &nullserv;
@@ -832,7 +832,10 @@ gaih_inet (const char *name, const struct gaih_service *service,
no_data = 0;
nss_gethostbyname4_r fct4
= __nss_lookup_function (nip, "gethostbyname4_r");
@@ -839,7 +839,10 @@ gaih_inet (const char *name, const struc
if (req->ai_family == PF_UNSPEC)
fct4 = __nss_lookup_function (nip, "gethostbyname4_r");
- if (fct4 != NULL)
+ /* If we don't want ipv6, don't use gethostbyname4_r,
+ as it's using T_UNSPEC to libc_res_nsearch, which always
@ -23,7 +23,7 @@ index 1a023f9..c8af8b9 100644
{
int herrno;
@@ -935,7 +938,7 @@ gaih_inet (const char *name, const struct gaih_service *service,
@@ -942,7 +945,7 @@ gaih_inet (const char *name, const struc
if (fct != NULL)
{
if (req->ai_family == AF_INET6
@ -32,7 +32,7 @@ index 1a023f9..c8af8b9 100644
{
gethosts (AF_INET6, struct in6_addr);
no_inet6_data = no_data;
@@ -2418,7 +2421,11 @@ getaddrinfo (const char *name, const char *service,
@@ -2462,7 +2465,11 @@ getaddrinfo (const char *name, const cha
if (hints->ai_family == AF_UNSPEC || hints->ai_family == AF_INET
|| hints->ai_family == AF_INET6)
{

View File

@ -1,3 +1,13 @@
-------------------------------------------------------------------
Sat Nov 24 13:48:40 UTC 2012 - aj@suse.de
- Remove nscd init script, use systemd files.
-------------------------------------------------------------------
Fri Nov 23 14:33:37 UTC 2012 - matz@suse.com
- Fix getaddrinfo-ipv6-sanity.diff to apply again.
-------------------------------------------------------------------
Tue Nov 20 08:06:49 UTC 2012 - aj@suse.de

View File

@ -33,6 +33,7 @@ BuildRequires: fdupes
BuildRequires: libselinux-devel
BuildRequires: makeinfo
BuildRequires: xz
BuildRequires: pkgconfig(systemd)
%if %{with glibc_run_testsuite}
BuildRequires: gcc-c++
BuildRequires: libstdc++-devel
@ -129,7 +130,6 @@ Source: glibc-%{version}-%{git_id}.tar.xz
Source3: noversion.tar.bz2
Source4: manpages.tar.bz2
Source5: nsswitch.conf
Source6: nscd.init
Source7: bindresvport.blacklist
Source8: glibc_post_upgrade.c
Source9: glibc.rpmlintrc
@ -315,12 +315,9 @@ Locale data for the internationalisation features of the GNU C library.
Summary: Name Service Caching Daemon
License: GPL-2.0+
Group: System/Daemons
Provides: aaa_base:/etc/init.d/nscd
Provides: glibc:/usr/sbin/nscd
Requires: glibc = %{version}
Requires(preun): %insserv_prereq
Requires(post): %insserv_prereq
Requires(postun): %insserv_prereq
%{?systemd_requires}
%description -n nscd
Nscd caches name service lookups and can dramatically improve
@ -466,7 +463,7 @@ rm nscd/s-stamp
%patch300 -p1
%patch301 -p1
#%patch302 -p1
%patch302 -p1
%patch304 -p1
%patch305 -p1
%patch306 -p1
@ -901,8 +898,7 @@ popd
cp nscd/nscd.conf %{buildroot}/etc
mkdir -p %{buildroot}/etc/init.d
install -m 755 %{SOURCE6} %{buildroot}/etc/init.d/nscd
ln -sf /etc/init.d/nscd %{buildroot}/usr/sbin/rcnscd
ln -sf /sbin/service %{buildroot}/usr/sbin/rcnscd
mkdir -p %{buildroot}/var/run/nscd
touch %{buildroot}/var/run/nscd/{passwd,group,hosts}
touch %{buildroot}/var/run/nscd/{socket,nscd.pid}
@ -1000,12 +996,14 @@ done
%postun info
%install_info_delete --info-dir=%{_infodir} %{_infodir}/libc.info.gz
%preun -n nscd
%pre -n nscd
%service_add_pre nscd.service
%stop_on_removal nscd
%preun -n nscd
%service_del_preun nscd.service
%post -n nscd
%{insserv_force_if_yast nscd}
%service_add_post nscd.service
mkdir -p /var/run/nscd
# Previously we had nscd.socket, remove it
test -x /usr/bin/systemctl && /usr/bin/systemctl stop nscd.socket || :
@ -1015,8 +1013,7 @@ rm -f /etc/systemd/system/sockets.target.wants/nscd.socket
exit 0
%postun -n nscd
%restart_on_update nscd
%insserv_cleanup
%service_del_postun nscd.service
exit 0
#######################################################################
@ -1243,7 +1240,6 @@ exit 0
%files -n nscd
%defattr(-,root,root)
%config(noreplace) /etc/nscd.conf
%config /etc/init.d/nscd
%{_sbindir}/nscd
%{_sbindir}/rcnscd
/lib/systemd/system/nscd.service

125
nscd.init
View File

@ -1,125 +0,0 @@
#! /bin/sh
# Copyright (c) 1995-2004 SuSE Linux AG, Nuernberg, Germany.
# Copyright (c) 2005 SUSE LINUX Products GmbH, Nuernberg, Germany.
# All rights reserved.
#
# Author: Ruediger Oertel
# Thorsten Kukuk
#
# Please send feedback to http://www.suse.de/feedback
#
# init.d/nscd
#
# and symbolic its link
#
# /usr/sbin/rcnscd
#
# System startup script for the NIS daemon
#
### BEGIN INIT INFO
# Provides: nscd
# Required-Start: $remote_fs $time
# Should-Start: $syslog $named winbind
# Should-Stop: $null
# Required-Stop: $null
# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Short-Description: Start Name Service Cache Daemon
# Description: Start Name Service Cache Daemon
### END INIT INFO
# Source SuSE config
. /etc/rc.status
NSCD_BIN=/usr/sbin/nscd
test -x $NSCD_BIN || { echo "$NSCD_BIN not installed";
if [ "$1" = "stop" ]; then exit 0; else exit 5; fi; }
NSCD_CONFIG=/etc/nscd.conf
test -r $NSCD_CONFIG || { echo "$NSCD_CONFIG not existing";
if [ "$1" = "stop" ]; then exit 0; else exit 6; fi; }
NSCD_PID=/var/run/nscd/nscd.pid
# Shell functions sourced from /etc/rc.status:
# rc_check check and set local and overall rc status
# rc_status check and set local and overall rc status
# rc_status -v ditto but be verbose in local rc status
# rc_status -v -r ditto and clear the local rc status
# rc_failed set local and overall rc status to failed
# rc_reset clear local rc status (overall remains)
# rc_exit exit appropriate to overall rc status
# First reset status of this service
rc_reset
# Return values acc. to LSB for all commands but status:
# 0 - success
# 1 - misc error
# 2 - invalid or excess args
# 3 - unimplemented feature (e.g. reload)
# 4 - insufficient privilege
# 5 - program not installed
# 6 - program not configured
#
case "$1" in
start)
echo -n "Starting Name Service Cache Daemon"
# /var/run might be on tmpfs
[ -d /var/run/nscd ] || mkdir /var/run/nscd
/sbin/startproc -p $NSCD_PID $NSCD_BIN
rc_status -v
;;
stop)
echo -n "Shutting down Name Service Cache Daemon"
/sbin/killproc -p $NSCD_PID -TERM $NSCD_BIN
# if nscd does not run as root, it cannot remove this files:
rm -f /var/run/nscd/socket $NSCD_PID
rc_status -v
;;
try-restart|condrestart)
## RH has a similar command named condrestart.
if test "$1" = "condrestart"; then
echo "${attn} Use try-restart ${done}(LSB)${attn} rather than condrestart ${warn}(RH)${norm}"
fi
$0 status
if test $? = 0; then
$0 restart
else
rc_reset # Not running is not a failure.
fi
rc_status
;;
restart)
## Stop the service and regardless of whether it was
## running or not, start it again.
$0 stop
$0 start
rc_status
;;
force-reload)
echo "Reload Name Service Cache Daemon"
$0 try-restart
rc_status
;;
reload)
# nscd does not support SIGHUP, so fail.
echo -n "Reload Name Service Cache Daemon"
rc_failed 3
rc_status -v
;;
status)
echo -n "Checking for Name Service Cache Daemon: "
/sbin/checkproc -p $NSCD_PID $NSCD_BIN
rc_status -v
;;
probe)
test $NSCD_CONFIG -nt $NSCD_PID && echo restart
;;
*)
echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload|probe}"
exit 1
;;
esac
rc_exit