From owner-freebsd-hackers Sat Feb 20 10:13:59 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from cs.rpi.edu (mumble.cs.rpi.edu [128.213.8.16]) by hub.freebsd.org (Postfix) with ESMTP id 295CE1183F for ; Sat, 20 Feb 1999 10:13:52 -0800 (PST) (envelope-from crossd@cs.rpi.edu) Received: from cs.rpi.edu (monica.cs.rpi.edu [128.213.7.2]) by cs.rpi.edu (8.9.1/8.9.1) with ESMTP id NAA27406 for ; Sat, 20 Feb 1999 13:13:46 -0500 (EST) Message-Id: <199902201813.NAA27406@cs.rpi.edu> To: freebsd-hackers@freebsd.org Subject: race condition in rc/rc.network Date: Sat, 20 Feb 1999 13:13:46 -0500 From: "David E. Cross" Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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