How to debug rc hangs?
Doug Barton
dougb at FreeBSD.org
Tue Oct 23 10:49:54 PDT 2007
On Wed, 24 Oct 2007, John Marshall wrote:
> [blush] I actually fixed this 12 months ago on 6.n and forgot all about it. I
> let the 7.0 mergemaster overwrite the rc.d/ypset because I didn't think I had
> touched it.
>
> Here is the fix. All happy now - but not much the wiser as to rc
> troubleshooting techniques.
>
> -----------------------------------------------
> --- /usr/src/etc/rc.d/ypset 2007-10-12 12:38:42.000000000 +1000
> +++ /etc/rc.d/ypset 2007-10-24 02:31:32.000000000 +1000
> @@ -5,6 +5,7 @@
>
> # PROVIDE: ypset
> # REQUIRE: ypbind
> +# BEFORE: mountd
>
> . /etc/rc.subr
John,
Thanks for digging into this yourself, always nice when someone answers
their own questions. :)
In regards to your proposed solution, I would like to explore this with
you a little. In general it would be preferred to add REQUIRE: ypset in
mountd instead of using BEFORE. This makes debugging easier down the road.
The other thing I'm interested in is the relationship between this change
and the other yp* stuff. I've attached a patch that I use to debug the
rcorder stuff. If you could copy your /etc/rc to a handy directory, apply
the patch, and then run 'sh rc'. If you could do that before and after
applying the change you suggested (using REQUIRE instead of BEFORE if you
don't mind) I'd be interested if anything else changes besides the
ypset/mountd relationship.
My concern is that in my rcorder (basically stock RELENG_6 with some
ports) ypxfrd, ypudated, and ypset are all running in that order, and late
in the overall order. I'm concerned that if we move ypset earlier (and
mountd is run a lot earlier than those 3) it will have other side effects.
I also noticed that ypserv and ypbind are run much than even mountd, and
since I don't use NIS I don't really know what those side effects might be
(if any).
I may be a little overcautious here, but experience has taught us that
even seemingly small changes can have large and unanticipated
consequences.
Doug
--
This .signature sanitized for your protection
-------------- next part --------------
--- /etc/rc 2007-07-06 22:26:09.000000000 -0700
+++ rc 2007-10-23 10:35:03.000000000 -0700
@@ -85,8 +47,12 @@
#
files=`rcorder ${skip} /etc/rc.d/* 2>/dev/null`
+# XXX
+rm -f rc.early* rc.late
+
for _rc_elem in ${files}; do
- run_rc_script ${_rc_elem} ${_boot}
+ #run_rc_script ${_rc_elem} ${_boot}
+ echo $_rc_elem >> rc.early1
case "$_rc_elem" in
*/${early_late_divider}) break ;;
@@ -107,16 +73,22 @@
_skip_early=1
for _rc_elem in ${files}; do
case "$_skip_early" in
- 1) case "$_rc_elem" in
+ 1)
+ echo $_rc_elem >> rc.early2
+ case "$_rc_elem" in
*/${early_late_divider}) _skip_early=0 ;;
esac
continue
;;
esac
- run_rc_script ${_rc_elem} ${_boot}
+ echo $_rc_elem >> rc.late
+
+ #run_rc_script ${_rc_elem} ${_boot}
done
+diff -u rc.early*
+
echo ''
date
exit 0
More information about the freebsd-rc
mailing list