Subject: bin/10002: `network' rc.d dependency is incomplete
To: None <gnats-bugs@gnats.netbsd.org>
From: None <thorpej@zembu.com>
List: netbsd-bugs
Date: 04/27/2000 22:09:14
>Number: 10002
>Category: bin
>Synopsis: `network' rc.d dependency is incomplete
>Confidential: no
>Severity: serious
>Priority: high
>Responsible: bin-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Thu Apr 27 22:10:01 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator: Jason R. Thorpe
>Release: April 24, 2000
>Organization:
Zembu Labs, Inc.
>Environment:
NetBSD sysbuild 1.4X NetBSD 1.4X (ZEMBU-ENGLAB) #3: Tue Apr 25 14:37:27 PDT 2000 thorpej@sysbuild:/u1/Zembu/netbsd/src/sys/arch/i386/compile/ZEMBU-ENGLAB i386
>Description:
The `network' dependency node in rc.d doesn't completely start
the network. In fact, if you are using DHCP, it leaves the
network woefully down. This causes some programs to behave
erratically when they start.
>How-To-Repeat:
Use DHCP for network configuration. Watch it get started very
late. Watch other programs behave poorly when this happens.
>Fix:
I fixed this by making the current `network' node provide
`network_basics'. The dhclient script in turn requires
`network_basics' and provides `network'. This solves the
network-isn't-quite-up problem.
However, it does present a different problem. dhclient used
to require `systemfs', because it deposits things in /var, and
systemfs cleans out various directories in /var. This clearly
won't work with the above change, because systemfs requires
`mountcritremote', which can't possibly happen until the network
is fully up.
My solution to this problem may be controversial -- require that
/var be a critical-local file system. If you do this, you can
place the guts of systemfs into mountcritlocal, and change
`systemfs' to be a dummy dependency.
A diff for all of this is included below. With these changes,
I can successfully use DHCP to completely configure the network
on a system, and have all network applications work properly.
Index: dhclient
===================================================================
RCS file: /home/cvsfiles/netbsd/src/etc/rc.d/dhclient,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -c -r1.1.1.2 -r1.2
*** dhclient 2000/04/13 19:06:52 1.1.1.2
--- dhclient 2000/04/28 00:01:36 1.2
***************
*** 3,10 ****
# $NetBSD: dhclient,v 1.3 2000/04/06 17:19:13 thorpej Exp $
#
! # PROVIDE: dhclient
! # REQUIRE: systemfs syslogd
. /etc/rc.subr
. /etc/rc.conf
--- 3,10 ----
# $NetBSD: dhclient,v 1.3 2000/04/06 17:19:13 thorpej Exp $
#
! # PROVIDE: network
! # REQUIRE: network_basics
. /etc/rc.subr
. /etc/rc.conf
Index: mountcritlocal
===================================================================
RCS file: /home/cvsfiles/netbsd/src/etc/rc.d/mountcritlocal,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -c -r1.1.1.1 -r1.2
*** mountcritlocal 2000/03/31 19:55:31 1.1.1.1
--- mountcritlocal 2000/04/28 00:01:36 1.2
***************
*** 10,16 ****
. /etc/rc.conf
name="mountcritlocal"
! start_cmd="mount_critical_filesystems local"
stop_cmd=":"
run_rc_command "$1"
--- 10,30 ----
. /etc/rc.conf
name="mountcritlocal"
! start_cmd="mountcritlocal_start"
stop_cmd=":"
+
+ mountcritlocal_start()
+ {
+ mount_critical_filesystems local
+
+ #
+ # clean up left-over files.
+ # this could include the cleanup of lock files and /var/run, etc.
+ #
+ rm -f /etc/nologin /var/spool/lock/LCK.* /var/spool/uucp/STST/*
+ (cd /var/run && {
+ rm -rf -- *; install -c -m 664 -g utmp /dev/null utmp;
+ })
+ }
run_rc_command "$1"
Index: network
===================================================================
RCS file: /home/cvsfiles/netbsd/src/etc/rc.d/network,v
retrieving revision 1.1.1.3
retrieving revision 1.3
diff -c -r1.1.1.3 -r1.3
*** network 2000/04/25 00:25:19 1.1.1.3
--- network 2000/04/28 00:05:43 1.3
***************
*** 3,9 ****
# $NetBSD: network,v 1.7 2000/04/20 02:12:04 itojun Exp $
#
! # PROVIDE: network
# REQUIRE: root mountcritlocal tty sysctl
. /etc/rc.subr
--- 3,9 ----
# $NetBSD: network,v 1.7 2000/04/20 02:12:04 itojun Exp $
#
! # PROVIDE: network_basics
# REQUIRE: root mountcritlocal tty sysctl
. /etc/rc.subr
Index: systemfs
===================================================================
RCS file: /home/cvsfiles/netbsd/src/etc/rc.d/systemfs,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -c -r1.1.1.1 -r1.2
*** systemfs 2000/03/31 19:55:31 1.1.1.1
--- systemfs 2000/04/28 00:01:36 1.2
***************
*** 6,27 ****
# PROVIDE: systemfs
# REQUIRE: network mountcritremote
! . /etc/rc.subr
! . /etc/rc.conf
!
! name="systemfs"
! start_cmd="systemfs_start"
! stop_cmd=":"
!
! systemfs_start()
! {
! # clean up left-over files.
! # this could include the cleanup of lock files and /var/run, etc.
! #
! rm -f /etc/nologin /var/spool/lock/LCK.* /var/spool/uucp/STST/*
! (cd /var/run && {
! rm -rf -- *; install -c -m 664 -g utmp /dev/null utmp;
! })
! }
!
! run_rc_command "$1"
--- 6,11 ----
# PROVIDE: systemfs
# REQUIRE: network mountcritremote
! # This is a dummy dependency, to ensure that certain system
! # programs are run _after_ the system-required file systems
! # are mounted.
>Release-Note:
>Audit-Trail:
>Unformatted: