FAM: FAMOpen(3X) fails but cause is not shown



The following C program fails and I can't find why.

------------------------------------------------------------
/* famcheck.c */
#include <fam.h>
#include <stdio.h>
#include <stdlib.h>

void error(const char *msg)
{
	int e = FAMErrno;
	perror(msg);
	fprintf(stderr, "FAMErrno=%d\n", e);
	exit(EXIT_FAILURE);
}

int main()
{
	FAMConnection fc;
	if (FAMOpen(&fc) != 0)
		error("FAMOpen");
	if (FAMClose(&fc) != 0)
		error("FAMClose");
	return EXIT_SUCCESS;
}
------------------------------------------------------------

It was compiled this way: gcc -g -Wall famcheck.c -lfam

It displays this:

    FAMOpen: Success
    FAMErrno=0

I am not surprised to see that both errno and FAMErrno are zero,
since that seems to be a known (and tolerated) bug with FAM.

However, I have no information to determine the cause of the failure.
Nothing appears in /var/log/messages or in /var/log/secure.

When I give the command

    touch ~/Desktop/foobar

the Nautilus desktop shows an icon for that file about 3 seconds
later.  This seems to indicate that the fam service is running.

/sbin/service says that the "xinetd" and "portmap" services are
running.

I have a Fedora Core 2 system with fam-2.6.10-9 and portmap-4.0-59.

The /etc/xinetd.d/sgi_fam file contains this:

------------------------------------------------------------
# default: off
# description: FAM is a file monitoring daemon. It can \
# be used to get reports when files change.
#
# The daemon conflicts with selinux, so you must boot
# with selinux disabled to use this.
service sgi_fam
{
	type         = RPC UNLISTED
        socket_type  = stream
        user         = root
        group        = nobody
        server       = /usr/bin/fam
	wait	     = yes
	protocol     = tcp
	rpc_version  = 2
	rpc_number   = 391002
	bind         = 127.0.0.1
	disable      = no
}
------------------------------------------------------------

(Isn't selinux disabled by default on Fedora Core 2?)


The /etc/grub.conf file contains this:

---------------------------------------------------------------------------
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You do not have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /, eg.
#          root (hd0,0)
#          kernel /boot/vmlinuz-version ro root=/dev/hda1
#          initrd /boot/initrd-version.img
#boot=/dev/hda
default=0
timeout=10
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
title Fedora Core (2.6.5-1.358)
	root (hd0,0)
	kernel /boot/vmlinuz-2.6.5-1.358 ro root=/dev/hda1
	initrd /boot/initrd-2.6.5-1.358.img
---------------------------------------------------------------------------


I was initially trying to use gnome_vfs_monitor_add(),
but this function failed with a GnomeVFSResult equal to
GNOME_VFS_ERROR_NOT_SUPPORTED.

-- 
Pierre Sarrazin <sarrazip at sympatico dot ca>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]