From e9212e5164877056cb44bd1be542f0ab8c1c0f1a Mon Sep 17 00:00:00 2001 From: "Robin H. Johnson" Date: Wed, 16 Jul 2014 12:07:56 -0700 Subject: net.lo: cached module list timing issue Handle cached modulelist being newer than current time, as it would not be recached even when needed; force recache. Signed-off-by: Robin H. Johnson X-Gentoo-Bug: 506966 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=506966 --- init.d/net.lo.in | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'init.d') diff --git a/init.d/net.lo.in b/init.d/net.lo.in index 5ea73c7..01c1b20 100644 --- a/init.d/net.lo.in +++ b/init.d/net.lo.in @@ -218,16 +218,20 @@ _show_address() _gen_module_list() { local x= f= force=$1 - if ! ${force} && [ -s "${MODULESLIST}" -a "${MODULESLIST}" -nt "${MODULESDIR}" ]; then - local update=false - for x in "${MODULESDIR}"/*.sh; do - [ -e "${x}" ] || continue - if [ "${x}" -nt "${MODULESLIST}" ]; then - update=true - break - fi - done - ${update} || return 0 + if ! ${force} ; then + if [ -s "${MODULESLIST}" -a "${MODULESLIST}" -nt /proc/$$/status ]; then + ewarn "Discarding cached module list ($MODULESLIST) as it's newer current time!" + elif [ -s "${MODULESLIST}" -a "${MODULESLIST}" -nt "${MODULESDIR}" ]; then + local update=false + for x in "${MODULESDIR}"/*.sh; do + [ -e "${x}" ] || continue + if [ "${x}" -nt "${MODULESLIST}" ]; then + update=true + break + fi + done + ${update} || return 0 + fi fi einfo "Caching network module dependencies" -- cgit v1.2.3-65-gdbad