[Bug 221948] New: load of bind during boot fails if ip-up starts modify_resolvconf at the same time.
https://bugzilla.novell.com/show_bug.cgi?id=221948 Summary: load of bind during boot fails if ip-up starts modify_resolvconf at the same time. Product: SUSE Linux 10.1 Version: Final Platform: Other OS/Version: SuSE Linux 10.1 Status: NEW Severity: Normal Priority: P5 - None Component: Basesystem AssignedTo: bnc-team-screening@forge.provo.novell.com ReportedBy: ulrich@holeschak.de QAContact: qa@suse.de Loading of bind (named) could fail during boot, if ip-up calls /sbin/modify_resolvconf at the same time (when using a DSL connection and modification of named.conf is enabled). modify_resolvconf calls "/etc/init.d/named reload". If this ist done EXACTLY at the same time when the boot process tries to start bind the start of bind fails. Normally this is happening very seldom, but on my machine this did happen very often. If have solved this by adding the following lock mechanism to the start section of /etc/init.d/named: --------------------------------------------- LOCKFILE="/var/lock/named.pid" removefiles=() declare -a removefiles function removeonexit() { removefiles[${#removefiles[@]}]="$1" } function cleanup() { local file for file in "${removefiles[@]}"; do rm -f "$file" done } trap cleanup EXIT function lockMessage() { tput bold echo -en "\nWarning: " tput sgr0 echo -e "$1 " } function setlock() { ### Locking mechanism LOCKED=0 while [ $LOCKED -eq 0 ]; do set -o noclobber echo "$$" 2> /dev/null > $LOCKFILE set +o noclobber read PID < $LOCKFILE if [ "$PID" != "$$" ]; then lockMessage "Another rcnamed with PID $PID found, waiting ..." i=0 while [ -e "$LOCKFILE" -a "$i" -lt 15 ]; do sleep 1 i=$(( i + 2 )) done if [ -e "$LOCKFILE" ]; then lockMessage "Lockfile is still there, ignoring it ..." kill -TERM $PID sleep 2 kill -KILL $PID rm -f "$LOCKFILE" fi else LOCKED=1 removeonexit "$LOCKFILE" fi done } setlock --------------------------------------------- The code is basically taken from SueFirewall2, but is improved a bit. I contrast to SuseFirewall2 i try to write the lockfile FIRST and then check if this writing was possible. This prevents race conditions if multiple instances of this code try to lock a the same time ... -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=221948 aj@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|bnc-team- |zoz@novell.com |screening@forge.provo.novell| |.com | -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=221948 zoz@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Component|Basesystem |Basesystem Product|SUSE Linux 10.1 |openSUSE 10.3 Version|Final |unspecified ------- Comment #1 from zoz@novell.com 2006-11-20 11:35 MST ------- This is to late for 10.2. Also 10.1 will not be fixed since this is really rare. But we have to take care of such cases in future products. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=221948 zoz@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ug@novell.com Status|ASSIGNED |NEEDINFO Info Provider| |ug@novell.com ------- Comment #2 from zoz@novell.com 2006-12-15 08:27 MST ------- Uwe what do you think about this problem and the proposed solution? -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=221948 ------- Comment #3 from ulrich@holeschak.de 2006-12-15 08:49 MST ------- In the meantime i have found out, that i have to add a small delay to the function cleanup(), otherwise it still could happen that the start of bind failes ... function cleanup() { local file sleep 1 for file in "${removefiles[@]}"; do rm -f "$file" done } -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=221948 zoz@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |zoz@novell.com AssignedTo|zoz@novell.com |ug@novell.com Status|ASSIGNED |NEW ------- Comment #5 from zoz@novell.com 2006-12-19 05:09 MST ------- Why? rcnamed reload does that. And looking at the named start script the reload section is not exactly that what /etc/init.d/skeleton reload suggests. And further, there is a bug in it: checkproc ... || echo "Warning ..." rc=$? if [ ${rc} -ne 0 ]; then rc will always be '0' This seems to be the problem of this bug. It should normally always be possible to call any service reload. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=221948 ------- Comment #6 from ulrich@holeschak.de 2006-12-19 15:07 MST ------- Thanks, i already looked at this line of code but havn't seen the bug. Now i have changed: checkproc -p ${NAMED_PID} ${NAMED_BIN} || echo "- Warning: named not running! " rc=$? to checkproc -p ${NAMED_PID} ${NAMED_BIN} rc=$? And it seems to work. I will now test it for a while because the problem not always happens ... -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=221948 ug@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=221948 ug@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |RESOLVED Resolution| |FIXED ------- Comment #7 from ug@novell.com 2007-01-02 07:53 MST ------- fixed for SP1 and the next OpenSUSE release -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
participants (1)
-
bugzilla_noreply@novell.com