glibc: nscd: Make it working.
authorStanislav Brabec <utx@penguin.cz>
Wed, 26 Aug 2009 21:14:00 +0000 (21:14 +0000)
committerutx@penguin.cz <utx@penguin.cz>
Wed, 26 Aug 2009 21:14:00 +0000 (21:14 +0000)
recipes/glibc/files/nscd-init.patch [new file with mode: 0644]
recipes/glibc/glibc-package.bbclass
recipes/glibc/glibc.inc
recipes/glibc/glibc_2.9.bb
recipes/glibc/glibc_cvs.bb

diff --git a/recipes/glibc/files/nscd-init.patch b/recipes/glibc/files/nscd-init.patch
new file mode 100644 (file)
index 0000000..884609a
--- /dev/null
@@ -0,0 +1,39 @@
+--- nscd/nscd.init
++++ nscd/nscd.init
+@@ -48,9 +48,8 @@
+ start () {
+     [ -d /var/run/nscd ] || mkdir /var/run/nscd
+-    [ -d /var/db/nscd ] || mkdir /var/db/nscd
+     echo -n $"Starting $prog: "
+-    daemon /usr/sbin/nscd
++    /usr/sbin/nscd
+     RETVAL=$?
+     echo
+     [ $RETVAL -eq 0 ] && touch /var/lock/subsys/nscd
+@@ -67,12 +66,10 @@
+       # a non-privileged user
+       rm -f /var/run/nscd/nscd.pid
+       rm -f /var/run/nscd/socket
+-              success $"$prog shutdown"
+-    else
+-              failure $"$prog shutdown"
+     fi
+-    echo
+-    return $RETVAL
++    echo "Done."
++    # If nscd did not run, return 0 according to LSB.
++    return 0
+ }
+ restart() {
+@@ -104,7 +101,8 @@
+       ;;
+     force-reload | reload)
+       echo -n $"Reloading $prog: "
+-      killproc /usr/sbin/nscd -HUP
++      # Use killall, initscripts-1.0-r115 don't support -HUP yet.
++      killall -HUP /usr/sbin/nscd
+       RETVAL=$?
+       echo
+       ;;
index 1ed1b7a..32ea0e3 100644 (file)
@@ -42,7 +42,7 @@ FILES_libsegfault = "${base_libdir}/libSegFault*"
 FILES_glibc-extra-nss = "${base_libdir}/libnss*"
 FILES_sln = "${base_sbindir}/sln"
 FILES_glibc-dev_append = " ${libdir}/*.o ${bindir}/rpcgen"
-FILES_nscd = "${sbindir}/nscd*"
+FILES_nscd = "${sbindir}/nscd* ${sysconfdir}/nscd* ${sysconfdir}/init.d/nscd*"
 FILES_glibc-utils = "${bindir}/* ${sbindir}/*"
 FILES_glibc-gconv = "${libdir}/gconv/*"
 FILES_${PN}-dbg += " ${libdir}/gconv/.debug ${libexecdir}/*/.debug"
@@ -60,6 +60,11 @@ DESCRIPTION_ldd = "glibc: print shared library dependencies"
 DESCRIPTION_localedef = "glibc: compile locale definition files"
 DESCRIPTION_glibc-utils = "glibc: misc utilities like iconf, local, gencat, tzselect, rpcinfo, ..."
 
+INITSCRIPT_NAME = "nscd"
+INITSCRIPT_PACKAGES = "nscd"
+INITSCRIPT_PARAMS = "start 40 S . stop 40 0 6 1 ."
+inherit update-rc.d
+
 def get_glibc_fpu_setting(bb, d):
     if bb.data.getVar('TARGET_FPU', d, 1) in [ 'soft' ]:
         return "--without-fp"
@@ -84,8 +89,10 @@ do_install() {
                mv ${WORKDIR}/SUPPORTED.tmp ${WORKDIR}/SUPPORTED
        done
        rm -f ${D}{sysconfdir}/rpc
-       install -d ${D}${sysconfdir}
+       install -d ${D}${sysconfdir}/init.d
+       install -m 0644 ${S}/nscd/nscd.conf ${D}${sysconfdir}/
        install -m 0644 ${WORKDIR}/etc/ld.so.conf ${D}${sysconfdir}/
+       install ${S}/nscd/nscd.init ${D}${sysconfdir}/init.d/nscd
 }
 
 TMP_LOCALE="/tmp/locale${libdir}/locale"
index 6e5ca68..6741b21 100644 (file)
@@ -11,7 +11,7 @@ PROVIDES = "virtual/libc virtual/${TARGET_PREFIX}libc-for-gcc"
 PROVIDES += "virtual/libintl virtual/libiconv"
 
 # INC_PR for glibc.inc, glibc-initial.inc and glibc-stage.inc
-INC_PR = "r34"
+INC_PR = "r35"
 
 inherit autotools
 
index 9849c0a..eb15750 100644 (file)
@@ -45,6 +45,7 @@ RDEPENDS_${PN}-dev = "linux-libc-headers-dev"
 SRC_URI = "ftp://ftp.gnu.org/pub/gnu/glibc/glibc-${PV}.tar.bz2 \
           ftp://ftp.gnu.org/pub/gnu/glibc/glibc-ports-2.7.tar.bz2 \
           ftp://ftp.gnu.org/pub/gnu/glibc/glibc-libidn-${PV}.tar.bz2 \
+          file://nscd-init.patch;patch=1;pnum=0 \
            file://arm-memcpy.patch;patch=1 \
            file://arm-longlong.patch;patch=1 \
            file://fhs-linux-paths.patch;patch=1 \
@@ -125,6 +126,8 @@ addtask munge before do_patch after do_unpack
 
 
 do_configure () {
+# /var/db was not included to FHS
+       sed -i s:/var/db/nscd:/var/run/nscd: ${S}/nscd/nscd.h
 # override this function to avoid the autoconf/automake/aclocal/autoheader
 # calls for now
 # don't pass CPPFLAGS into configure, since it upsets the kernel-headers
index 4d093de..5290dfa 100644 (file)
@@ -37,6 +37,7 @@ RPROVIDES_${PN}-dev += "libc-dev virtual-libc-dev"
 #         file://ldd.patch;patch=1;pnum=0 \
 SRC_URI = "cvs://anoncvs@sources.redhat.com/cvs/glibc;module=libc \
           cvs://anoncvs@sources.redhat.com/cvs/glibc;module=ports \
+          file://nscd-init.patch;patch=1;pnum=0 \
           file://arm-audit.patch;patch=1 \
           file://arm-audit2.patch;patch=1 \
           file://arm-memcpy.patch;patch=1 \
@@ -71,6 +72,8 @@ do_munge() {
 addtask munge before do_patch after do_unpack
 
 do_configure () {
+# /var/db was not included to FHS
+       sed -i s:/var/db/nscd:/var/run/nscd: ${S}/nscd/nscd.h
 # override this function to avoid the autoconf/automake/aclocal/autoheader
 # calls for now
 # don't pass CPPFLAGS into configure, since it upsets the kernel-headers