[Xorp-users] Compiling xorp, how to change default paths

Pavlin Radoslavov pavlin at icir.org
Mon Jan 15 11:34:13 PST 2007


> I'm using xorp 1.3 in RHEL4 from rpm (from Dries rpm repository). After installation, things are not as I would like them to be:
> 
> 1.  Default paths for templates etc are now:
> Boot file := /usr/config.boot
> Templates directory  := /usr/etc/templates
> Xrl targets directory  := /usr/xrl/targets
> 
> but rpm installs all templates etc to the /usr/share/xorp. And I would like that xorp would use /etc/xorp.conf instead of config.boot as it's config file.
> 
> Is there configure -option to do these things or do I need to edit some Makefile.in files?
> Rpm uses only this option to configure:
> --datadir=/usr/share/xorp

The default XORP installation directory is /usr/local/xorp, so it
seems that the RPM overwrites that value.
If you compile XORP by hand, then you can use the following command
to change the installation directory:

./configure --prefix=/path/to/installation/dir

I am not familiar in details with RPM, but you can check the rpm
manual page whether the rpm command itself gives you the option of
overwriting the installation path. E.g., check the "--prefix"
command line option.


Regarding using a different configuration file, you can use the "-b"
command line option. E.g.

xorp_rtrmgr -b /etc/xorp.conf

The templates directory can be specified with the "-t" command-line
option to xorp_rtrmgr. The XRL targets directory can be specified
with the "-x" command-line option.

If everything was installed relative to the XORP installation
directory, then you shouldn't need to explicitly specify the templates
directory and the XRL targets directory.

> 2. rpm installs xorp_rtrmgr to /usr/bin which is fine. Other parts such as xorp_fea are installed to /usr/bin too. And that is fine too.
> But when xorp_rtrmgr starts, it tries to find xorp_fea from /usr/fea/xorp_fea, same thing with other parts.
> So now I need to create /usr/"xorp-component" directories and symlink binaries from /usr/bin to /usr/"xorp-component".

All binaries executed by the xorp_rtrmgr are relative from the XORP
installation directory. E.g., the xorp_fea binary is suppose to be
found in <prefix>/fea/xorp_fea, the xorp_bgp binary is suppose to be
found in <prefix>/bgp/xorp_bgp, and so on.

> Can I change this easily so that xorp_rtrmgr would not use any static paths when starting those other parts?

To overwrite those values in XORP you need to edit the corresponding
rtrmgr template files (the *.tp files that are installed in the
template directory).

It seems that the RPM installation has decided to break the default
XORP setup and has scattered the XORP components (without providing
the glue between them).

Hence, you have the option of glueing things together (following the
above advice), or just download the vanilla XORP tarball and then
compile it and install it on your own.

> 3. I start xorp_rtrmgr to the backgroud and then kill it with SIGTERM. Is this proper way to shutdown xorp so that it can exit cleanly or should I use some other signal?

Yes, this should work.

FYI, if you download the latest XORP code (from CVS), in the
xorp/contrib/packages directory you will find scripts (currently
only for Debian) how to start XORP during boot.
You could try to adapt those scripts for your OS.

> 4. Template or Xrl files (I don't know what there are) have paths for commands, for example if file bgp.cmds has %command parameter:
>  show bgp peers {
>      %command: "bgp/tools/xorpsh_print_peers $0" %help: HELP;
>      %module: bgp;
>      %tag: HELP "Show BGP peers info";
>  }
> 
> That has path bgp/tools in it. rpm installs xorpsh_print_peers to /usr/bin/ and xorpsh does not start. I had to change that file (and others too) so that there is no paths in %command:
> 
> show bgp peers {
>     %command: "xorpsh_print_peers $0" %help: HELP;
>      %module: bgp;
>      %tag: HELP "Show BGP peers info";
>  }
> 
> Are those command paths somehow configurable when compiling?

No those paths are not configurable (apart of editing the *.tp and
*.cmds files themselves), and they are suppose to be relative to the
XORP (installation) root directory.

Again, given that the RPM breaks a number of things I'd recommend to
stay away from it and use the vanilla XORP tarball+installation.
It should compile for RedHat, but let us know if there are any
compilation issues.

Regards,
Pavlin



More information about the Xorp-users mailing list