AF:
NF:0
PS:10
SRH:1
SFN:
DSR:
MID:<20080530114536.6be9119f@ripper.onstor.net>
CFG:
PT:0
S:andy.sharp@onstor.com
RQ:
SSV:onstor-exch02.onstor.net
NSV:
SSH:
R:<larry.scheer@onstor.com>,<tim.gardner@onstor.com>,<rendell.fong@onstor.com>
MAID:1
X-Sylpheed-Privacy-System:
X-Sylpheed-Sign:0
SCF:#mh/Mailbox/sent
RMID:#imap/andys@onstor.net@onstor-exch02.onstor.net/INBOX	0	BB375AF679D4A34E9CA8DFA650E2B04E042F01AD@onstor-exch02.onstor.net
X-Sylpheed-End-Special-Headers: 1
Date: Fri, 30 May 2008 11:46:15 -0700
From: Andrew Sharp <andy.sharp@onstor.com>
To: "Larry Scheer" <larry.scheer@onstor.com>
Cc: "Tim Gardner" <tim.gardner@onstor.com>, "Rendell Fong"
 <rendell.fong@onstor.com>
Subject: Re: Adding routes on cougar and defect TED 23467
Message-ID: <20080530114615.7d26cd47@ripper.onstor.net>
In-Reply-To: <BB375AF679D4A34E9CA8DFA650E2B04E042F01AD@onstor-exch02.onstor.net>
References: <BB375AF679D4A34E9CA8DFA650E2B04E0A30AAAC@onstor-exch02.onstor.net>
	<BB375AF679D4A34E9CA8DFA650E2B04E042F01AD@onstor-exch02.onstor.net>
Organization: Onstor
X-Mailer: Sylpheed-Claws 2.6.0 (GTK+ 2.8.20; x86_64-pc-linux-gnu)
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit

~(I object to everything except the file name /etc/mygate)

Wuf, too much coding lately.

I'd like to request that we don't cling too tightly to the embarrassing
past, and instead call the file /etc/defaultroute on Linux (leave
it as-is on BSD) which is much more Unix-like.  This would amount to an
extremely minor code change to achieve, and it's much more
expected/intuitive for Linux-heads.

I also vote for leaving in the in-code comments.  The comments at the
top can be jettisoned closer to checkin time.

The code in the script is broken, but that can be fixed at
code/design review time.  The general plan has my thumbs up.  Nice job
youse guyz.

Cheers,

a

 On Fri, 30 May 2008 09:47:34 -0700 "Larry Scheer"
<larry.scheer@onstor.com> wrote:

> No reason other than it appears less cluttered and mysterious.
> 
> 
> -----Original Message-----
> From: Tim Gardner
> Sent: Fri 5/30/2008 12:19 AM
> To: Larry Scheer; Rendell Fong; Andy Sharp
> Subject: RE: Adding routes on cougar and defect TED 23467
>  
> Why would you remove the comments before checking in?
> 
> _____________________________________________
> From: Larry Scheer 
> Sent: Friday, May 30, 2008 12:10 AM
> To: Larry Scheer; Rendell Fong; Andy Sharp; Tim Gardner
> Subject: RE: Adding routes on cougar and defect TED 23467
> 
> Sorry I sent this without finishing a key sentence:
> 
> I have a heavily commented version of /etc/network/if-up.d/addroutes
> below that explains how the mygate and routes.ssc files work with
> addroutes. The comments also explain how we get around if-up running
> the route command on every interface that has auto set. The version I
> want to check in has no comments.
> 
> The advantage of preserving mygate and routes.ssc is we can reuse
> existing code and functionality in our current system and it
> simplifies how we add routes in cougar.
> 
> Let Rendlell and I know what you think,
> 
> Larry
> 
> _____________________________________________
> From: Larry Scheer 
> Sent: Friday, May 30, 2008 12:00 AM
> To: Rendell Fong; Andy Sharp; Tim Gardner
> Subject: Adding routes on cougar and defect TED 23467
> 
> Rendell and I worked out a way to eliminate the noise that occurs
> when the default route is added at boot time and also fix the
> problems we have on cougar where you can't add a static route with
> nfxsh or more than one route to the SSC. (You can do it on a bobcat
> (3.3) but not on a cougar.)
> 
> The plan is to go back to using /etc/mygate, a modified version
> of /etc/routes.ssc on Linux systems, and use an addroutes file that
> is not modified by our code.
> 
> I have a heavily commented version of /etc/network/if-up.d/addroutes
> below that explains the version I want to check in has no comments.
> 
> 
> #!/bin/sh
> #
> #  File:  /etc/network/if-up.d/addroutes
> # 
> # This file is exectuted by if-up for every interface configured as
> auto # in /etc/network/interfaces
> #
> # The files created in /tmp indicate a status of what routes were
> # added successfully on which interface
> #
> 
> # Only add routes to the eth0 and eth1 interfaces
> if [[ $IFACE == eth? ]] ; then
>     #if mygate exist read its contents to set the defaut route
>     [ -f /etc/mygate ] &&
>     while read MYGATE ; do
>         # if the route is already up don't try to set it for this
> interface if [ ! -f /tmp/default-route-up ] ; then
>             # only create the tmp file if the route succeeds for this
> interface route add default gw $MYGATE 2>/dev/null &&
>             echo "$IFACE" >/tmp/default-route-up
>         fi
>         # in case the route add was attempted on the wrong interface
> first # keep if-up from complaining by finishing with something
> positive ( the || true) done < /etc/mygate || true
> 
> 
>     #if static routes were set by nfxsh read the route data
>     [ -f /etc/routes.ssc ] &&
>     while read NET MASK GW ; do 
>         # if the route is already up don't try to set it for this
> interface if [ ! -f /tmp/${NET}-route ] ; then
>             # only create the tmp file if the route succeeds for this
> interface route add -net $NET netmask $MASK gw $GW 2>/dev/null &&
>             echo "$IFACE" >/tmp/${NET}-route
>         fi
>         # in case the route add was attempted on the wrong interface
> first # keep if-up from complaining by finishing with something
> positive ( the || true) done < /etc/routes.ssc || true
> fi
> 
> Sample /etc/mygate file:
> 10.2.0.1
> 
> Sample /etc/route.ssc file: (tab delimited)
> 192.168.0.0     255.255.0.0     192.168.101.10
> 
