Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Error in /etc/rc.d/staticroute



On Thu, 31 Jan 2008, Paul Goyette wrote:

> It appears that /etc/rc.d/staticroute expects the file /etc/route.conf to
> contain lines of text that describe individual static routes.  If the line
> starts with a '+' it is processed only during the "start" command, and if the
> line starts with a '-' it is processed only during the "stop" command.
> 
> But if the line does not start with either '+' or '-' it should be processed
> during both "start" and "stop".  Unfortunately the current
> /etc/rc.d/staticroute.conf seems to prepend a '-' in this case, leading to a
> command syntax error when the rest of the line is passed to /sbin/route
> 
> I think the following patch should be applied.  Either that, or my
> understanding of what was intended is rather broken!


I have never used this. I grepped my man pages and found the route.conf(5) 
manual. It shows the example:

net 192.168.2.0 -netmask 255.255.255.0 192.168.150.2

(Note no leading dash which means to remove.)

So the dash prefix is needed as in the modifier "-net".

The syntax is confusing.

It seems like /etc/rc.local and /etc/rc.shutdown could be used instead for 
the commands to run. And then complete route(8) commands listed in 
route.conf (even with leading minus - sign).

Or is the order critical that /etc/rc.local would not be good enough?

Note if your patch is used, the man page needs to be changed too.

  Jeremy C. Reed

p.s. I just update the script with a comment that points to the man page.



Home | Main Index | Thread Index | Old Index