Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 20 Feb 1999 13:13:46 -0500
From:      "David E. Cross" <crossd@cs.rpi.edu>
To:        freebsd-hackers@freebsd.org
Subject:   race condition in rc/rc.network
Message-ID:  <199902201813.NAA27406@cs.rpi.edu>

next in thread | raw e-mail | index | archive | help

There exists a race condition in the startup scripts when using amd to
automount a parition where shared libraries will be added with
'ldconfig_paths'.  The problem is that AMD returns before it is fully ready,
and is run (in network_pass3) almost immediately before the ldconfig line.
The solution is from the 'wait4amd' script that is included in the am-utils
distribution, but not included in our system??  It is basically to have a
'loose' loop check for amd being up before allowing the scripts to continue.
I have included my diffs to rc.network below, and I hope they will find a 
warm, caring home in the CVS tree :)

--
David Cross


*** rc.network.old      Sat Feb 20 12:56:18 1999
--- rc.network  Sat Feb 20 13:05:29 1999
***************
*** 284,294 ****
      fi
  
      if [ "X${amd_enable}" = X"YES" ]; then
!           echo -n ' amd'
            if [ "X${amd_map_program}" != X"NO" ]; then
                amd_flags="${amd_flags} `eval ${amd_map_program}`"
            fi
            amd -p ${amd_flags} > /var/run/amd.pid 2> /dev/null
      fi
  
      if [ "X${rwhod_enable}" = X"YES" ]; then
--- 284,299 ----
      fi
  
      if [ "X${amd_enable}" = X"YES" ]; then
!           echo -n ' amd('
            if [ "X${amd_map_program}" != X"NO" ]; then
                amd_flags="${amd_flags} `eval ${amd_map_program}`"
            fi
            amd -p ${amd_flags} > /var/run/amd.pid 2> /dev/null
+           while ! amq >/dev/null 2>&1; do
+               echo -n .
+               sleep 1;
+           done
+           echo -n ')'
      fi
  
      if [ "X${rwhod_enable}" = X"YES" ]; then



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199902201813.NAA27406>