BUILDING & INSTALLING FAM

You know the routine:

    ./configure
    make
    make install

If you would prefer to build & install an RPM image, see INSTALL.rpm.

To control compiler flags (such as whether you're building o32, n32, n64 etc.
on IRIX), you can use the --with-CFLAGS command-line option when running the
configure script.  For example, to build fam and libfam -n32 -mips3, you
could go:

    ./configure --with-CFLAGS="-n32 mips3"

Note that on IRIX, the fam which comes with the OS is /usr/etc/fam; by default,
the open-source version installs into /usr/local/bin/fam, so you'll still need
to follow most of the instructions below to get inetd to use your new fam.



STARTING FAM

Once it's installed, you'll want to start it up.  Normally, fam is started by
inetd when someone needs it; when its last client disconnects, fam waits around
for a few seconds to see whether anyone else wants to talk to it, and then
exits.  The install target doesn't modify your configuration files; you'll have
to do this yourself.

First, add the sgi_fam service to your /etc/rpc.  (It should already be there
on IRIX.)

    sgi_fam         391002  fam             # File Alteration Monitor       

Next, add fam to your /etc/inetd.conf.  (It should already be there on IRIX,
but note that the RPC version and path to fam will be different!)

    #  fam, the File Alteration Monitor.
    sgi_fam/1-2 stream  rpc/tcp wait    root    /usr/local/bin/fam      fam

Then tell inetd to reread its config file:

    killall -HUP inetd

You should make sure that inetd has re-registered fam with the portmapper:

    rpcinfo -p | grep fam

If that doesn't give you a couple lines of output (one for version 1, one
for version 2), you may need to restart the portmapper and/or inetd.
"/etc/init.d/network stop ; /etc/init.d/network start" works on IRIX, but
may be a bit heavy-handed.

If you're on IRIX and you already have some running fam clients (like the
desktop), log out, wait 6 seconds, and log back in, and make sure that the
new fam is running.  (You can use the fam test program for this, actually;
cd test/.libs && ./test -f /usr/etc/fam -f /usr/local/bin/fam should give
you a "started executing" event for /usr/local/bin/fam and NOT /usr/etc/fam.
If the old one is still running, some other client is still talking to it.)



IF YOU DON'T WANT TO START FAM THROUGH INETD

The other way to do it is to start fam yourself, and tell it to stick around
even when there are no clients.  That's actually easier (although on IRIX
you'll still have to remove fam from /etc/inetd.conf, etc.):

    /usr/local/bin/fam -T 0

You could put this in a startup script, etc.  (Make sure it's after the
portmapper is started.)  The disadvantage here is that fam is hanging around
even when no one is using it.  There is more discussion on this approach at
http://oss.sgi.com/projects/fam/irix.html.

