fam
[Top] [All Lists]

Re: Problem using fam in linux redhat (monitor.c)

To: Michael Wardle <michael.wardle@xxxxxxxxxx>
Subject: Re: Problem using fam in linux redhat (monitor.c)
From: Martin Wickman <martin@xxxxxxxxxxx>
Date: Sat, 19 Oct 2002 16:29:04 +0200
Cc: fam@xxxxxxxxxxx
References: <3DAF1F0E.4010808@xxxxxxxxxxx> <1034915858.18272.28.camel@zeus>
Sender: fam-bounce@xxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1) Gecko/20020827
Michael Wardle wrote:
> On Fri, 2002-10-18 at 06:35, Martin Wickman wrote:

Hi Martin

Hi and thanks for your reply.

[chop]

I get 'permission denied' if running as a normal user, or 'address already in use' if running as root.

[chop]

Most of your output (including what looks like RPC errors) matches my
output, yet monitor.c from the Using FAM section of the IRIX Desktop
Integration Guide (I assume this is the tutorial you are referring to)
works for me.

Correct.

(I assume your "fam -C -d" output and your "strace
./monitor" output were from different attempts, because the socket file
name (e.g. /tmp/.famXYZabc) should match.)

Correct.

The only way I was able to reproduce your output was when the file I was
trying to monitor (such as monitor.c in "./monitor monitor.c") had no
read permissions.  Have you tried monitoring other files or changing the
permissions on the file you are monitoring?

This got me started testing "the more obvious things" :-)

It seems that I must provide an absolute path to the file or get an error. Maybe this is the way it should work?

Here is a short scenario fyi:

$ pwd
/home/wic/proj/famtest
$ ./monitor no_such_file              # sanity check
no_such_file: No such file or directory
FAMMonitor failed: Illegal seek
Nothing monitored.
$ touch a
$ ls -l a
-rw-rw-r--    1 wic      wic  0 Oct 19 16:12 a
$ ./monitor a                         # relative
FAMMonitor failed: Permission denied  # fails
Nothing monitored.
$ ./monitor ./a                       # relative
FAMMonitor failed: Permission denied  # fails
Nothing monitored.
$ ./monitor /home/wic/proj/famtest/a  # absolute
/home/wic/proj/famtest/a FAMExists    # works
$ touch ../../a
$ ./monitor ../../a                   # relative
FAMMonitor failed: Permission denied  # fails
Nothing monitored.
$ ./monitor /home/wic/a               # absolute
/home/wic/a              FAMExists    # works


What happens when monitor is executed as root does look like a bug at
this point, but I've not looked into it yet.

Using root gives the same problem, but different errors ("address already in use"):

# pwd
/home/wic/proj/famtest
# ./monitor no_such_file                  # sanity check
no_such_file: No such file or directory
FAMMonitor failed: Illegal seek
Nothing monitored.
# ./monitor a                             # relative
FAMMonitor failed: Address already in use # fails
Nothing monitored.
# ./monitor ./a                           # relative
FAMMonitor failed: Address already in use # fails
Nothing monitored.
# ./monitor /home/wic/proj/famtest/a      # absolute
/home/wic/proj/famtest/a FAMExists        # works
#
# ./monitor ../../a                       # relative
FAMMonitor failed: Address already in use # fails
Nothing monitored.

Thanks!



<Prev in Thread] Current Thread [Next in Thread>