Adding static routes

15 views
Skip to first unread message

fence47

unread,
Sep 5, 2010, 4:21:05 AM9/5/10
to PyMacAdmin
Hi,

thanks to this group I was able to solve a problem we had applying
static routes. As a relative new person to OSX, was quite surprised at
the difficulty in solving such a relatively simple task.

Thankfully after the demise of kicker.xml you kind folk produced
crankd.

But there was still a problem...

Since the most appropriate place to install crankd was the /Library/
LaunchDaemons rather than /System, crankd is started after the ipv4
interface is up and running. Therefore no event is received to say
that the interface is now up and we can add our static route! Works
fine if you change location, unplug ethernet, etc though..

So routecrankd.py was born. A stripped down crankd which applies that
static routes when the daemon starts, and when the ip interface state
changes. (I took out what I did not have the time to try and
understand)

This is my first python code, so please feel free to be critical for
the sake of improvement.Perhaps it can be moved into the source code
repository for pymacadmin in the near future?

For the future, routecrankd functionality could be included in crankd
with the addition of a once off timer event. Or it could be argued
that the "static route" problem is so common it deserves a more
tightly focused and simple solution that is easy to implement for the
non advanced (ahem... non CLI) admin types.

Finally, any one knows how to add a static without having to resort to
running the route shell command, that would be nice to include here.

Thanks again everyone.
Allan

PS I'd forgotten how much I hated vi. ;-)
Reply all
Reply to author
Forward
0 new messages