From 86421136e69869bd9b353fdce26f19be2e372785 Mon Sep 17 00:00:00 2001 From: David Michael Date: Fri, 10 Mar 2017 11:59:24 -0800 Subject: [PATCH] sys-libs/glibc: install nscd service files The actual nscd binary has been installed since sssd was added, but none of the systemd configuration files were included. This resulted in a binary that would not start due to a missing /run directory. The upstream nscd.conf is installed in /usr and linked into /etc. --- .../glibc/files/eblits/src_install.eblit | 15 ++++- .../coreos-overlay/sys-libs/glibc/files/nscd | 64 ------------------- .../sys-libs/glibc/files/nscd-conf.tmpfiles | 2 + .../sys-libs/glibc/files/nscd.service | 15 ----- .../sys-libs/glibc/files/nscd.tmpfilesd | 4 -- .../sys-libs/glibc/files/nsswitch.conf | 24 ------- ...bc-2.23-r3.ebuild => glibc-2.23-r4.ebuild} | 0 7 files changed, 15 insertions(+), 109 deletions(-) delete mode 100644 sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/files/nscd create mode 100644 sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/files/nscd-conf.tmpfiles delete mode 100644 sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/files/nscd.service delete mode 100644 sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/files/nscd.tmpfilesd delete mode 100644 sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/files/nsswitch.conf rename sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/{glibc-2.23-r3.ebuild => glibc-2.23-r4.ebuild} (100%) diff --git a/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/files/eblits/src_install.eblit b/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/files/eblits/src_install.eblit index bb20991e55..6d0353f7bf 100644 --- a/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/files/eblits/src_install.eblit +++ b/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/files/eblits/src_install.eblit @@ -144,7 +144,7 @@ toolchain-glibc_src_install() { # - The SDK just gets the full locale archive, no need for locale-gen. # - CoreOS targets (which are cross compiled) don't get any locales. # - Config files are installed by baselayout, not glibc. - # - Forget about nscd for now, we have the use flag off anyway. + # - Install nscd/systemd stuff in /usr. if ! tc-is-cross-compiler ; then emake install_root="${D}$(alt_prefix)" localedata/install-locales || die @@ -166,10 +166,21 @@ toolchain-glibc_src_install() { # Clean out any default configs rm -rf "${ED}"/etc + cd "${S}" + + # Install misc network config files + insinto /usr/share/baselayout + doins nscd/nscd.conf || die + + if ! in_iuse nscd || use nscd ; then + systemd_dounit nscd/nscd.service || die + systemd_newtmpfilesd nscd/nscd.tmpfiles nscd.conf || die + systemd_newtmpfilesd "${FILESDIR}"/nscd-conf.tmpfiles nscd-conf.conf || die + fi + echo 'LDPATH="include ld.so.conf.d/*.conf"' > "${T}"/00glibc doenvd "${T}"/00glibc || die - cd "${S}" for d in BUGS ChangeLog* CONFORMANCE FAQ NEWS NOTES PROJECTS README* ; do [[ -s ${d} ]] && dodoc ${d} done diff --git a/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/files/nscd b/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/files/nscd deleted file mode 100644 index ff7154335f..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/files/nscd +++ /dev/null @@ -1,64 +0,0 @@ -#!/sbin/openrc-run -# Copyright 1999-2005 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Id$ - -depend() { - use dns ldap net slapd -} - -checkconfig() { - if [ ! -d /var/run/nscd ] ; then - mkdir -p /var/run/nscd - chmod 755 /var/run/nscd - fi - if [ -z "${NSCD_PERMS_OK}" ] && [ "$(stat -c %a /var/run/nscd)" != "755" ] ; then - echo "" - ewarn "nscd run dir is not world readable, you should reset the perms:" - ewarn "chmod 755 /var/run/nscd" - ewarn "chmod a+rw /var/run/nscd/socket" - echo "" - ewarn "To disable this warning, set 'NSCD_PERMS_OK' in /etc/conf.d/nscd" - echo "" - fi -} - -start() { - checkconfig - - ebegin "Starting Name Service Cache Daemon" - local secure=`while read curline ; do - table=${curline%:*} - entries=${curline##$table:} - table=${table%%[^a-z]*} - case $table in - passwd*|group*|hosts) - for entry in $entries ; do - case $entry in - nisplus*) - /usr/sbin/nscd_nischeck $table || \ - /echo "-S $table,yes" - ;; - esac - done - ;; - esac - done < /etc/nsswitch.conf` - local pidfile="$(strings /usr/sbin/nscd | grep nscd.pid)" - mkdir -p "$(dirname ${pidfile})" - save_options pidfile "${pidfile}" - start-stop-daemon --start --quiet \ - --exec /usr/sbin/nscd --pidfile "${pidfile}" \ - -- $secure - eend $? -} - -stop() { - local pidfile="$(get_options pidfile)" - [ -n "${pidfile}" ] && pidfile="--pidfile ${pidfile}" - ebegin "Shutting down Name Service Cache Daemon" - start-stop-daemon --stop --quiet --exec /usr/sbin/nscd ${pidfile} - eend $? -} - -# vim:ts=4 diff --git a/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/files/nscd-conf.tmpfiles b/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/files/nscd-conf.tmpfiles new file mode 100644 index 0000000000..0cf43dcb7a --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/files/nscd-conf.tmpfiles @@ -0,0 +1,2 @@ +L /etc/nscd.conf - - - - ../usr/share/baselayout/nscd.conf +d /var/db/nscd - - - - - diff --git a/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/files/nscd.service b/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/files/nscd.service deleted file mode 100644 index 25a3b1d9be..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/files/nscd.service +++ /dev/null @@ -1,15 +0,0 @@ -[Unit] -Description=Name Service Cache Daemon -After=network.target - -[Service] -ExecStart=/usr/sbin/nscd -F -ExecStop=/usr/sbin/nscd --shutdown -ExecReload=/usr/sbin/nscd -i passwd -ExecReload=/usr/sbin/nscd -i group -ExecReload=/usr/sbin/nscd -i hosts -ExecReload=/usr/sbin/nscd -i services -Restart=always - -[Install] -WantedBy=multi-user.target diff --git a/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/files/nscd.tmpfilesd b/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/files/nscd.tmpfilesd deleted file mode 100644 index 52edbba673..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/files/nscd.tmpfilesd +++ /dev/null @@ -1,4 +0,0 @@ -# Configuration to create /run/nscd directory -# Used as part of systemd's tmpfiles - -d /run/nscd 0755 root root diff --git a/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/files/nsswitch.conf b/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/files/nsswitch.conf deleted file mode 100644 index f28d534edf..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/files/nsswitch.conf +++ /dev/null @@ -1,24 +0,0 @@ -# /etc/nsswitch.conf: -# $Id$ - -passwd: compat -shadow: compat -group: compat - -# passwd: db files nis -# shadow: db files nis -# group: db files nis - -hosts: files dns -networks: files dns - -services: db files -protocols: db files -rpc: db files -ethers: db files -netmasks: files -netgroup: files -bootparams: files - -automount: files -aliases: files diff --git a/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/glibc-2.23-r3.ebuild b/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/glibc-2.23-r4.ebuild similarity index 100% rename from sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/glibc-2.23-r3.ebuild rename to sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/glibc-2.23-r4.ebuild