Subject: Re: adding extra to /etc/rc.d
To: Mipam <mipam@ibb.net>
From: Luke Mewburn <lukem@wasabisystems.com>
List: netbsd-help
Date: 03/06/2001 11:16:58
On Mon, Mar 05, 2001 at 06:05:14PM -0500, Mipam wrote:
> On my previous question i guess that using the rc.d system by Lukem
> would be convenient, but i dont understand i well enough.
> in /etc/defaults i added an entry:
>
> arpentries=YES
> arpentries_flags="/etc/ARP_entries"
>
> and in /etc/rc.d i made a file arpentries:
>
> #!/bin/sh
>
> # PROVIDE: arp_entries
> # REQUIRE: network mountcritical
>
> . /etc/rc.subr
>
> name="arp"
> rcvar=$name
> command="/usr/sbin/${name}"
>
> load_rc_config $name
> run_rc_command "$1"
> At startup i get the message:
> /etc/rc: WARNING: $arp is not set properly.
> What's wrong about it, i cant seem to figure it out,
> what to change to make it work?
> Now, at startup the files are first processed through rcorder
> and my arpentries ends up completly last, how can i make
> it so that it even is processed before dhclient, iow, that rcorder
> places it before dhclient?
As Jeremy Reed said, you need to change the definition of rcvar to
rcvar=arpentries
As to your overall problem, you've run into a slight chicken and egg
problem:
* arp is in /usr/sbin
* /usr is mounted by mountcritremote
* mountcritremote depends upon NETWORK, which depends upon
network & dhclient
So unless /usr is in /, you can't run arp before dhclient. (Or you move
/usr from $critical_filesystems to $critical_filesystems_beforenet)
If /usr is part of /, you could change the top of your script with
something like:
# PROVIDE: arpentries
# REQUIRE: network mountcritical
# BEFORE: dhclient
The use of `BEFORE' allows you to insert items into the tree before a
given dependency without requiring you to modify the script that
provides that dependency.
Luke.
--
Luke Mewburn <lukem@wasabisystems.com> http://www.wasabisystems.com
Luke Mewburn <lukem@netbsd.org> http://www.netbsd.org
Wasabi Systems - providing NetBSD sales, support and service.