Subject: Re: ifwatchd config in rc.conf
To: None <netbsd-help@netbsd.org>
From: James K. Lowden <jklowden@schemamania.org>
List: netbsd-help
Date: 12/10/2002 01:43:45
On Tue, 10 Dec 2002 13:29:36 +1100, "J. Piers Hearn"
<endareth@spamcop.net> wrote:
> Currently I have 
> ifwatchd=YES set in my rc.conf, and that results in my pppoe0 interface 
> being watched, and /etc/ppp/ip-up and down being run properly, that's
> fine, no problem there. But I also want /etc/ppp/stf0/ip-up and down to
> be run when the stf0 interface comes up. I'm able to do this manually by
> running ifwatchd -u /etc/ppp/stf0/ip-up -d /etc/ppp/stf0/ip-down stf0,
> but I can't seem to work out how to modify things in the rc.conf/rc.d
> area

You need two daemon processes, for pppoe0 and stf0, yes?  I don't know any
way to convince rc.conf to do that.  If you have two ifwatchd lines in
your rc.conf, the second overrides the first.  You'd have the same problem
trying to run two name servers or two ftp daemons.  

It looks to me, though, that there's a cheap way out.  If in
/etc/rc.d/ifwatchd, right after 
	run_rc_command "$1"

you add a line
	run_rc_command "-u /etc/ppp/stf0/ip-up -d /etc/ppp/stf0/ip-down stf0"

That sure seems like it should work.  Then again, lots of things seem
right at 1:30 AM.  

HTH.

--jkl