RE: What order are options in rc.conf processed?

2009-07-27 Thread Peter Steele
Well, if I understand what you mean, then yes, our app requires
networking. But it has two logic paths: If it sees the system has an IP
assigned it goes into one mode and if it does not have an IP assigned it
goes into another mode. In the case we've encountered the app takes the
"no IP assigned" path, even though we have an IP defined in rc.conf.
We're trying to understand how this could happen and are wondering how
the options in rc.conf are processed.

-Original Message-
From: Jason [mailto:jhelf...@e-e.com] 
Sent: Monday, July 27, 2009 2:44 PM
To: Peter Steele
Cc: freebsd-questions@freebsd.org
Subject: Re: What order are options in rc.conf processed?

Does your application startup script require NETWORKING?

Just a shot in the dark from a newbie.

-jgh

On Mon, Jul 27, 2009 at 02:43:04PM -0700, Peter Steele thus spake:
>We have an rc.conf file that looks something like this:
>
>
>
>ifconfig_nfe0="UP"
>
>ifconfig_nfe1="UP"
>
>cloned_interfaces="lagg0"
>
>ifconfig_lagg0="laggproto failover laggport nfe0 laggport nfe1 
>netmask "
>
>defaultrouter=
>
>...
>
>ourapp_enable="YES"
>
>
>
>In a recent reboot test, when "ourapp" started, it checked to see if an
>IP was assigned to the system and there was not, causing it to take an
>unexpected logic path. Our understanding though was that since we had
an
>entry in rc.conf defining the IP then our app should have started after
>that IP was assigned. Is this true or is there potentially a timing
>issue here?
>
>
>
>___
>freebsd-questions@freebsd.org mailing list
>http://lists.freebsd.org/mailman/listinfo/freebsd-questions
>To unsubscribe, send any mail to
"freebsd-questions-unsubscr...@freebsd.org"
>
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


RE: What order are options in rc.conf processed?

2009-07-27 Thread Peter Steele
>rc.conf is just a script that sets a bunch of environment variables for
the
>/etc/rc.d/* scripts to use.  The order the variables are set in that
file
>does not matter.  If you want your script to run after network
interfaces
>are set up, you'll want to add a "REQUIRE: NETWORKING" line.  See the
>rc and rcorder manpages for more info, and take a look at the files in
>/etc/rc.d/ for examples.

Okay, thanks. That's exactly what I was looking for. I'll check the man
page for these.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: What order are options in rc.conf processed?

2009-07-27 Thread Jason

Your startup script needs to require NETWORKING, though, and any other
service it may need.

Beyond this, you can use the rcorder command.

-jgh

On Mon, Jul 27, 2009 at 03:07:24PM -0700, Peter Steele thus spake:

Well, if I understand what you mean, then yes, our app requires
networking. But it has two logic paths: If it sees the system has an IP
assigned it goes into one mode and if it does not have an IP assigned it
goes into another mode. In the case we've encountered the app takes the
"no IP assigned" path, even though we have an IP defined in rc.conf.
We're trying to understand how this could happen and are wondering how
the options in rc.conf are processed.

-Original Message-
From: Jason [mailto:jhelf...@e-e.com]
Sent: Monday, July 27, 2009 2:44 PM
To: Peter Steele
Cc: freebsd-questions@freebsd.org
Subject: Re: What order are options in rc.conf processed?

Does your application startup script require NETWORKING?

Just a shot in the dark from a newbie.

-jgh

On Mon, Jul 27, 2009 at 02:43:04PM -0700, Peter Steele thus spake:

We have an rc.conf file that looks something like this:



ifconfig_nfe0="UP"

ifconfig_nfe1="UP"

cloned_interfaces="lagg0"

ifconfig_lagg0="laggproto failover laggport nfe0 laggport nfe1 
netmask "

defaultrouter=

...

ourapp_enable="YES"



In a recent reboot test, when "ourapp" started, it checked to see if an
IP was assigned to the system and there was not, causing it to take an
unexpected logic path. Our understanding though was that since we had

an

entry in rc.conf defining the IP then our app should have started after
that IP was assigned. Is this true or is there potentially a timing
issue here?



___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to

"freebsd-questions-unsubscr...@freebsd.org"





___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: What order are options in rc.conf processed?

2009-07-27 Thread Dan Nelson
In the last episode (Jul 27), Peter Steele said:
> We have an rc.conf file that looks something like this:
[...] 
> In a recent reboot test, when "ourapp" started, it checked to see if an IP
> was assigned to the system and there was not, causing it to take an
> unexpected logic path.  Our understanding though was that since we had an
> entry in rc.conf defining the IP then our app should have started after
> that IP was assigned.  Is this true or is there potentially a timing issue
> here?

rc.conf is just a script that sets a bunch of environment variables for the
/etc/rc.d/* scripts to use.  The order the variables are set in that file
does not matter.  If you want your script to run after network interfaces
are set up, you'll want to add a "REQUIRE: NETWORKING" line.  See the
rc and rcorder manpages for more info, and take a look at the files in
/etc/rc.d/ for examples.

-- 
Dan Nelson
dnel...@allantgroup.com
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: What order are options in rc.conf processed?

2009-07-27 Thread Mel Flynn
On Monday 27 July 2009 13:43:04 Peter Steele wrote:

> In a recent reboot test, when "ourapp" started, it checked to see if an
> IP was assigned to the system and there was not, causing it to take an
> unexpected logic path. Our understanding though was that since we had an
> entry in rc.conf defining the IP then our app should have started after
> that IP was assigned. Is this true or is there potentially a timing
> issue here?

It is false. See the manpage for rcorder, specifically the BEFORE and REQUIRE 
keywords. However, there still may be a timing issue, if ourapp requires the 
interface to be up (not just an IP assigned).
-- 
Mel
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: What order are options in rc.conf processed?

2009-07-27 Thread Jason

Does your application startup script require NETWORKING?

Just a shot in the dark from a newbie.

-jgh

On Mon, Jul 27, 2009 at 02:43:04PM -0700, Peter Steele thus spake:

We have an rc.conf file that looks something like this:



ifconfig_nfe0="UP"

ifconfig_nfe1="UP"

cloned_interfaces="lagg0"

ifconfig_lagg0="laggproto failover laggport nfe0 laggport nfe1 
netmask "

defaultrouter=

...

ourapp_enable="YES"



In a recent reboot test, when "ourapp" started, it checked to see if an
IP was assigned to the system and there was not, causing it to take an
unexpected logic path. Our understanding though was that since we had an
entry in rc.conf defining the IP then our app should have started after
that IP was assigned. Is this true or is there potentially a timing
issue here?



___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"