Can't read files from /proc

Marc Kaplan MKaplan at snapappliance.com
Thu Apr 10 21:42:27 GMT 2003


As a workaround, you could write a shell script called from a cron job that
calls the periodically calls the relevant proc functions and writes them to
files in a different file system. I guess you could also put the shell
script in a preexec line so that when a client connects it will be run.

			-Marc

> -----Original Message-----
> From: MCCALL,DON (HP-USA,ex1) [mailto:don_mccall at hp.com]
> Sent: Wednesday, April 09, 2003 10:51 AM
> To: 'Alexander Fedtke'; samba-technical at lists.samba.org
> Subject: RE: Can't read files from /proc
> 
> 
> Right.
> /proc is a virtual file system; the files don't contain any data,
> accessing them from LINUX generates data about the system on the fly,
> and in fact, on my system, they HAVE a file size of zero.  Which would
> explain why clients trying to read them via windows thru samba would
> open them and immediately close them - file size zero - as far as they
> are concerned, nothing to read.
> Hope this helps,
> Don
> 
> 
> 
> > -----Original Message-----
> > From: Alexander Fedtke [mailto:ubf at gmx.net]
> > Sent: Wednesday, April 09, 2003 13:25
> > To: samba-technical at lists.samba.org
> > Subject: Can't read files from /proc
> > 
> > 
> > Hello,
> > 
> > after processing all the articles from the mailing list and 
> > checking the
> > samba source code....
> > 
> > I want samba (2.2.8) to export the /proc filesystem - but 
> > exported files
> > seem to be empty :(
> > 
> > The "don't descent /proc" statement is removed from smb.conf.
> > Windows clients are able to list all files from /proc (a file 
> > size of 0
> > Bytes is shown).
> > Opening a file works fine but all files seems to be EMPTY :(
> > 
> > I did analyse and attached log.smbd: the difference between 
> opening a
> > regular file and a file from /proc is: after opening and locking the
> > file, a regular file results in SBMreadbraw command while 
> > opening a file
> > from /proc results in SMBclose command (marked with '<<====')
> > 
> > 
> > Is there a chance to read /proc from windows clients?
> > What is wrong?
> > 
> > Can you tell me where in the source (name of function) I can fix it?
> > 
> > Thank you very much for any hint in advance
> > Alexander
> > 
> > 
> > Opening file /proc/uptime for reading
> > =====================================
> > 
> > [2003/04/09 17:56:38, 3] lib/util.c:unix_clean_name(387)
> >   unix_clean_name [proc/uptime]
> > [2003/04/09 17:56:38, 4] smbd/open.c:open_file_shared1(973)
> >   calling open_file with flags=0x0 flags2=0x0 mode=0744
> > [2003/04/09 17:56:38, 2] smbd/open.c:open_file(246)
> >   - opened file proc/uptime read=Yes write=No (numopen=3)
> > [2003/04/09 17:56:38, 3]
> > smbd/oplock_linux.c:linux_set_kernel_oplock(186)
> >   linux_set_kernel_oplock: got kernel oplock on file 
> > proc/uptime, dev =
> > 2, inode = 4097, file_id = 3
> > [2003/04/09 17:56:38, 3] smbd/process.c:process_smb(851)
> >   Transaction 41 of length 45
> > [2003/04/09 17:56:38, 3] smbd/process.c:switch_message(687)
> >   switch message SMBclose (pid 238)
> > <<<=========
> > [2003/04/09 17:56:38, 4] smbd/uid.c:change_to_user(113)
> >   change_to_user: Skipping user change - already user
> > [2003/04/09 17:56:38, 3] smbd/reply.c:reply_close(3189)
> >   close fd=26 fnum=8544 (numopen=3)
> > [2003/04/09 17:56:38, 2] smbd/close.c:close_normal_file(229)
> >   nobody closed file proc/uptime (numopen=2) 
> > 
> > 
> > Opening regular file /boot.fstype for reading
> > =============================================
> > 
> > [2003/04/09 17:55:59, 3] lib/util.c:unix_clean_name(387)
> >   unix_clean_name [/boot.fstype]
> > [2003/04/09 17:55:59, 3] smbd/dosmode.c:unix_mode(111)
> >   unix_mode(boot.fstype) returning 0744
> > [2003/04/09 17:55:59, 3] lib/util.c:unix_clean_name(387)
> >   unix_clean_name [boot.fstype]
> > [2003/04/09 17:55:59, 4] smbd/open.c:open_file_shared1(973)
> >   calling open_file with flags=0x0 flags2=0x0 mode=0744
> > [2003/04/09 17:55:59, 2] smbd/open.c:open_file(246)
> >   - opened file boot.fstype read=Yes write=No (numopen=2)
> > [2003/04/09 17:55:59, 3]
> > smbd/oplock_linux.c:linux_set_kernel_oplock(186)
> >   linux_set_kernel_oplock: got kernel oplock on file 
> > boot.fstype, dev =
> > 101, inode = 3, file_id = 2
> > [2003/04/09 17:55:59, 3] smbd/process.c:process_smb(851)
> >   Transaction 19 of length 55
> > [2003/04/09 17:55:59, 3] smbd/process.c:switch_message(687)
> >   switch message SMBreadbraw (pid 238)
> > <<<===========
> > [2003/04/09 17:55:59, 4] smbd/uid.c:change_to_user(113)
> >   change_to_user: Skipping user change - already user
> > [2003/04/09 17:55:59, 3] smbd/reply.c:reply_readbraw(2365)
> >   readbraw fnum=8543 start=0 max=4096 min=0 nread=4 
> > 
> 


More information about the samba-technical mailing list