I’m a long time flow-tools user and am in the very early stages of migrating to
nfdump.
I'm attempting to execute nfcapd on a generic RHEL5 system and I'm getting a
stat() failed error telling me that my flow base dir is an invalid argument.
This feels like a really basic permissions problem, so I've checked the
permissions of my flow base dir, deleted it, recreated it, chmod'ed it, chown'd
it, etc., with no success. I also strace'd the execution of nfcapd looking for
more information about the call to stat() but that was not enlightening either.
As a last resort, I compiled a C stat() reference program and executed it
against my directory and that program completed successfully.
I dug through the nfdump mailing lists archives and I don't see anyone else
having this issue so I figured I'd post the problem here.
Here are the ugly details.
-bash-3.2$ whoami
mrtg <- I'm running as the user named "mrtg"
-bash-3.2$
-bash-3.2$ ./nfcapd -V
./nfcapd: Version: 1.6.10p1 $Date: 2013-08-06 10:31:45 +0200 (Tue, 06 Aug 2013)
$ <- my nfcpad version info
-bash-3.2$
-bash-3.2$ ./nfcapd -w -D -l /opt/netflow/v9flows -p 2099
stat() failed on /opt/netflow/v9flows: Invalid argument <- this is the error
message
-bash-3.2$
-bash-3.2$ ls -ald /opt/netflow/v*
drwxr-xr-x 2 mrtg isjnetpt 4096 Aug 29 12:38 /opt/netflow/v9flows <- this
is my nfcapd flow base dir, owned by userid=mrtg and with 755 perms
-bash-3.2$
This is the strace output when I launch nfcapd. Strangely enough, I see lots of
calls to stat(<some_other_file_or_dir>) but never a call to
stat(/opt/netflow/v9flows).
-bash-3.2$ strace ./nfcapd -w -D -l /opt/netflow/v9flows -p 2099
execve("./nfcapd", ["./nfcapd", "-w", "-D", "-l", "/opt/netflow/v9flows", "-p",
"2099"], [/* 29 vars */]) = 0
brk(0) = 0x15dd000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0x2b38fd0f2000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0x2b38fd0f3000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("/opt/CA/SharedComponents/ETPKI/../lib/tls/x86_64/libresolv.so.2",
O_RDONLY) = -1 ENOENT (No such file or directory)
stat("/opt/CA/SharedComponents/ETPKI/../lib/tls/x86_64", 0x7ffff9553680) = -1
ENOENT (No such file or directory)
open("/opt/CA/SharedComponents/ETPKI/../lib/tls/libresolv.so.2", O_RDONLY) = -1
ENOENT (No such file or directory)
stat("/opt/CA/SharedComponents/ETPKI/../lib/tls", 0x7ffff9553680) = -1 ENOENT
(No such file or directory)
open("/opt/CA/SharedComponents/ETPKI/../lib/x86_64/libresolv.so.2", O_RDONLY) =
-1 ENOENT (No such file or directory)
stat("/opt/CA/SharedComponents/ETPKI/../lib/x86_64", 0x7ffff9553680) = -1
ENOENT (No such file or directory)
open("/opt/CA/SharedComponents/ETPKI/../lib/libresolv.so.2", O_RDONLY) = -1
ENOENT (No such file or directory)
stat("/opt/CA/SharedComponents/ETPKI/../lib", {st_mode=S_IFDIR|0755,
st_size=4096, ...}) = 0
open("/opt/CA/SharedComponents/lib/tls/x86_64/libresolv.so.2", O_RDONLY) = -1
ENOENT (No such file or directory)
stat("/opt/CA/SharedComponents/lib/tls/x86_64", 0x7ffff9553680) = -1 ENOENT (No
such file or directory)
open("/opt/CA/SharedComponents/lib/tls/libresolv.so.2", O_RDONLY) = -1 ENOENT
(No such file or directory)
stat("/opt/CA/SharedComponents/lib/tls", 0x7ffff9553680) = -1 ENOENT (No such
file or directory)
open("/opt/CA/SharedComponents/lib/x86_64/libresolv.so.2", O_RDONLY) = -1
ENOENT (No such file or directory)
stat("/opt/CA/SharedComponents/lib/x86_64", 0x7ffff9553680) = -1 ENOENT (No
such file or directory)
open("/opt/CA/SharedComponents/lib/libresolv.so.2", O_RDONLY) = -1 ENOENT (No
such file or directory)
stat("/opt/CA/SharedComponents/lib", {st_mode=S_IFDIR|0755, st_size=4096, ...})
= 0
open("/opt/CA/CAlib/tls/x86_64/libresolv.so.2", O_RDONLY) = -1 ENOENT (No such
file or directory)
stat("/opt/CA/CAlib/tls/x86_64", 0x7ffff9553680) = -1 ENOENT (No such file or
directory)
open("/opt/CA/CAlib/tls/libresolv.so.2", O_RDONLY) = -1 ENOENT (No such file or
directory)
stat("/opt/CA/CAlib/tls", 0x7ffff9553680) = -1 ENOENT (No such file or
directory)
open("/opt/CA/CAlib/x86_64/libresolv.so.2", O_RDONLY) = -1 ENOENT (No such file
or directory)
stat("/opt/CA/CAlib/x86_64", 0x7ffff9553680) = -1 ENOENT (No such file or
directory)
open("/opt/CA/CAlib/libresolv.so.2", O_RDONLY) = -1 ENOENT (No such file or
directory)
stat("/opt/CA/CAlib", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
open("/usr/lib/tls/x86_64/libresolv.so.2", O_RDONLY) = -1 ENOENT (No such file
or directory)
stat("/usr/lib/tls/x86_64", 0x7ffff9553680) = -1 ENOENT (No such file or
directory)
open("/usr/lib/tls/libresolv.so.2", O_RDONLY) = -1 ENOENT (No such file or
directory)
stat("/usr/lib/tls", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
open("/usr/lib/x86_64/libresolv.so.2", O_RDONLY) = -1 ENOENT (No such file or
directory)
stat("/usr/lib/x86_64", 0x7ffff9553680) = -1 ENOENT (No such file or directory)
open("/usr/lib/libresolv.so.2", O_RDONLY) = -1 ENOENT (No such file or
directory)
stat("/usr/lib", {st_mode=S_IFDIR|0755, st_size=32768, ...}) = 0
open("/opt/CA/SharedComponents/Csam/SockAdapter/lib/tls/x86_64/libresolv.so.2",
O_RDONLY) = -1 ENOENT (No such file or directory)
stat("/opt/CA/SharedComponents/Csam/SockAdapter/lib/tls/x86_64",
0x7ffff9553680) = -1 ENOENT (No such file or directory)
open("/opt/CA/SharedComponents/Csam/SockAdapter/lib/tls/libresolv.so.2",
O_RDONLY) = -1 ENOENT (No such file or directory)
stat("/opt/CA/SharedComponents/Csam/SockAdapter/lib/tls", 0x7ffff9553680) = -1
ENOENT (No such file or directory)
open("/opt/CA/SharedComponents/Csam/SockAdapter/lib/x86_64/libresolv.so.2",
O_RDONLY) = -1 ENOENT (No such file or directory)
stat("/opt/CA/SharedComponents/Csam/SockAdapter/lib/x86_64", 0x7ffff9553680) =
-1 ENOENT (No such file or directory)
open("/opt/CA/SharedComponents/Csam/SockAdapter/lib/libresolv.so.2", O_RDONLY)
= -1 ENOENT (No such file or directory)
stat("/opt/CA/SharedComponents/Csam/SockAdapter/lib", {st_mode=S_IFDIR|0755,
st_size=4096, ...}) = 0
open("/etc/ld.so.cache", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=59564, ...}) = 0
mmap(NULL, 59564, PROT_READ, MAP_PRIVATE, 3, 0) = 0x2b38fd0f4000
close(3) = 0
open("/lib64/libresolv.so.2", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0203\200+;\0\0\0"...,
832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=92816, ...}) = 0
mmap(0x3b2b800000, 2181896, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3,
0) = 0x3b2b800000
mprotect(0x3b2b811000, 2097152, PROT_NONE) = 0
mmap(0x3b2ba11000, 8192, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x11000) = 0x3b2ba11000
mmap(0x3b2ba13000, 6920, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x3b2ba13000
close(3) = 0
open("/opt/CA/SharedComponents/ETPKI/../lib/libc.so.6", O_RDONLY) = -1 ENOENT
(No such file or directory)
open("/opt/CA/SharedComponents/lib/libc.so.6", O_RDONLY) = -1 ENOENT (No such
file or directory)
open("/opt/CA/CAlib/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or
directory)
open("/usr/lib/tls/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/opt/CA/SharedComponents/Csam/SockAdapter/lib/libc.so.6", O_RDONLY) = -1
ENOENT (No such file or directory)
open("/lib64/libc.so.6", O_RDONLY) = 3
read(3,
"\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\220\332\301';\0\0\0"..., 832) =
832
fstat(3, {st_mode=S_IFREG|0755, st_size=1718232, ...}) = 0
mmap(0x3b27c00000, 3498328, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3,
0) = 0x3b27c00000
mprotect(0x3b27d4d000, 2097152, PROT_NONE) = 0
mmap(0x3b27f4d000, 20480, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x14d000) = 0x3b27f4d000
mmap(0x3b27f52000, 16728, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x3b27f52000
close(3) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0x2b38fd103000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0x2b38fd104000
arch_prctl(ARCH_SET_FS, 0x2b38fd103b80) = 0
mprotect(0x3b27f4d000, 16384, PROT_READ) = 0
mprotect(0x3b2ba11000, 4096, PROT_READ) = 0
mprotect(0x3b27a1c000, 4096, PROT_READ) = 0
munmap(0x2b38fd0f4000, 59564) = 0
write(2, "stat() failed on /opt/netflow/v9"..., 56stat() failed on
/opt/netflow/v9flows: Invalid argument
) = 56
exit_group(255) = ?
-bash-3.2$
I know stat() works because the output below is what is produced by the stat()
man page reference program at the bottom of http://linux.die.net/man/2/stat.
-bash-3.2$ ./stat-test /opt/netflow/v9flows/
File type: directory
I-node number: 2
Mode: 40755 (octal)
Link count: 1159
Ownership: UID=725 GID=0
Preferred I/O block size: 8 bytes
File size: 4096 bytes
Blocks allocated: 1378211639
Last status change: Wed Dec 31 18:00:00 1969
Last file access: Wed Dec 31 18:00:00 1969
Last file modification: Wed Dec 31 18:00:00 1969
-bash-3.2$
I feel like I’m missing something really basic here - am I'm using the -l flag
correctly? I've tried all kinds of iterations of the nfcapd command line opts
and I always get that stat error.
If you are not the intended recipient of this message (including attachments),
or if you have received this message in error, immediately notify us and delete
it and any attachments.
If you do not wish to receive any email messages from us, excluding
administrative communications, please email this request to
[email protected] along with the email address you wish to unsubscribe.
For important additional information related to this email, visit
www.edwardjones.com/US_email_disclosure. Edward D. Jones & Co., L.P. d/b/a
Edward Jones, 12555 Manchester Road, St. Louis, MO 63131 © Edward Jones. All
rights reserved.
------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
Nfdump-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nfdump-discuss