Re: [Samba] Re: Different behaviour of samba share in XP and Windows 2003 Server

2005-03-25 Thread Kiran VM
On Thu, 24 Mar 2005 11:01:02 -0800, Jeremy Allison [EMAIL PROTECTED] wrote:
 On Thu, Mar 24, 2005 at 11:11:44PM +0530, Kiran VM wrote:
  Hello Jerry,
 
  No CloseHandle() call is made in both the case. CFile (or for that
  reason CStdioFile) Close() method will close the OS file handle.
  (closehandle() in the sample code is commented given can be ignored)
 
  Just to make it a bit more clearer, the executable (for testing i just
  put the sample code above inside a for loop of 1000) is run from a
  win2k3 server and xp machine. XP shows no handle increase leak (handle
  count of 85), but in Win2k3 the handle count was around 1085 ( for
  1000 iterations). This information i got from the windows task
  manager. Upon this, i tried the procexp tool from sysinternals. This
  clearly showed that the Handle being leaked is a file handle,
  \\TestServer\TestShare in our case. (This is not the file as such but
  the directory).
 
  BTW, my samba server is on Solaris 9.
 
  Please let me know if you erquire any further information...
 
 Can you send me the binary (.exe) of this program. Also, the
 information on how to report any handle leaks on the Windows
 side. Given that info I can try to track this one on my own.
 
 Thanks,
 
Jeremy.
 
Hello Jeremy, Hello Jerry,

I have attached a test exe (tester.exe) which will reproduce the
problem. ( rename the tester.exe1 to tester.exe inside the zip file tester.zip1)

Just run tester with the remote file name (from the samba share) as
the parameter. (eg. Tester.exe \\TestServer\TestShare\tempfile.txt).
The program will open the given file 1000 times in a loop. The source
code for this is also attached if you want to make any change. If you
run this on a Win2K3 server, the handle count increases to 1000 and
on an XP client it is around 10.

You can see the handle count in the taskmanager itself. In the process
tab of task manager, select the option view-select columns. here
check the Handle count check box. Now just monitor the tester.exe
process (when it is runnning) in the task manager, you can see the
count there.

Task manager does not show what kind of handles are open. For this we
use a free ware from systinternals (called procexp). This can be
downloaded from
http://www.sysinternals.com/ntw2k/freeware/procexp.shtml.(i can send
it if you want.)  Just run this tool and select
tester.exe when it is running. This will show all the open handles on
the bottom pane. On Win2K3 server, we can see that there are many file
handles are open to the directory in our samba share.

If you still could not reproduce this problem, please let me know.
Also, if you require more info from me, please let me know.

Thanks and best regards,
Kiran

PS: Just a brief desc about by samba config.

Im running a 64 bit Samba 3.0.10( tried 3.0.13 also)  on Solaris 9
with the smb conf something like this.



[global]
   workgroup = NMUSOL
   netbios name = TestServer
   interfaces = 132.186.71.238
   bind interfaces only = Yes
   security = DOMAIN
   password server = 132.186.70.122
   log level = 2
   ldap ssl = no
   kernel oplocks = no

[TestShare]
   path = /export/home1/TestShare
   read only = No
   oplocks = no
   strict locking = yes
   level2 oplocks = no
-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/listinfo/samba

Re: [Samba] Re: Different behaviour of samba share in XP and Windows 2003 Server

2005-03-25 Thread Kiran VM
 
 Hello Jeremy, Hello Jerry,
 
 I have attached a test exe (tester.exe) which will reproduce the
 problem. ( rename the tester.exe1 to tester.exe inside the zip file 
 tester.zip1)
 
 Just run tester with the remote file name (from the samba share) as
 the parameter. (eg. Tester.exe \\TestServer\TestShare\tempfile.txt).
 The program will open the given file 1000 times in a loop. The source
 code for this is also attached if you want to make any change. If you
 run this on a Win2K3 server, the handle count increases to 1000 and
 on an XP client it is around 10.
 
 You can see the handle count in the taskmanager itself. In the process
 tab of task manager, select the option view-select columns. here
 check the Handle count check box. Now just monitor the tester.exe
 process (when it is runnning) in the task manager, you can see the
 count there.
 
 Task manager does not show what kind of handles are open. For this we
 use a free ware from systinternals (called procexp). This can be
 downloaded from
 http://www.sysinternals.com/ntw2k/freeware/procexp.shtml.(i can send
 it if you want.)  Just run this tool and select
 tester.exe when it is running. This will show all the open handles on
 the bottom pane. On Win2K3 server, we can see that there are many file
 handles are open to the directory in our samba share.
 
 If you still could not reproduce this problem, please let me know.
 Also, if you require more info from me, please let me know.
 
 Thanks and best regards,
 Kiran
 
 PS: Just a brief desc about by samba config.
 
 Im running a 64 bit Samba 3.0.10( tried 3.0.13 also)  on Solaris 9
 with the smb conf something like this.
 
 [global]
   workgroup = NMUSOL
   netbios name = TestServer
   interfaces = 132.186.71.238
   bind interfaces only = Yes
   security = DOMAIN
   password server = 132.186.70.122
   log level = 2
   ldap ssl = no
   kernel oplocks = no
 
 [TestShare]
   path = /export/home1/TestShare
   read only = No
   oplocks = no
   strict locking = yes
   level2 oplocks = no
 
 
 

Hello Jerry, Jeremy,

Sorry, iam not able to send attachement to the list so let me put the
code in the mail itself.

Im Msdev, start a new project,  select win32 console application. give
the project name as Tester. Then in the tester.cpp put the following
code compile and execute as mentioned in my earlier mail.

Please let me know if you require any other info.

Thanks,
Kiran


___n_
// Tester.cpp : Defines the entry point for the console application.
//

#include stdafx.h
#include Tester.h

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/
// The one and only application object

CWinApp theApp;

using namespace std;

int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
{
int nRetCode = 0;

// initialize MFC and print and error on failure
if (!AfxWinInit(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), 0))
{
// TODO: change error code to suit your needs
cerr  _T(Fatal Error: MFC initialization failed)  endl;
return 1;
}

if( argc != 2)
{
cout _T(Usage: Tester.exe complete UNC path of the shared 
file)endl;
cout _T(Example: Tester.exe
TestServer\\TestShare\\tempfile.txt)endl;
return 1;
}

CString strFileName = argv[1];
int nCount = 1000;

cout  _T(Opening file )(LPCTSTR)strFileName_T(
)nCount_T( times)endl;

for (int i = 0; i  nCount ; i++)
{

CFile fValueFile;
if( !fValueFile.Open(strFileName,CFile::modeReadWrite  ) )
{
cout_T(Open failed with error)GetLastError()endl;
}
else
{
coutOpened for iteration iendl;
}


fValueFile.Close();



}

cout_T(Iteration completed. Press enter to exit)endl;

getchar();

return 0;
}
// Tester.cpp : Defines the entry point for the console application.
//

#include stdafx.h
#include Tester.h

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/
// The one and only application object

CWinApp theApp;

using namespace std;

int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
{
int nRetCode = 0;

// initialize MFC and print and error on failure
if (!AfxWinInit(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), 0))
{
// TODO: change error code to suit your needs
cerr  _T(Fatal Error: MFC initialization 

[Samba] Different behaviour of samba share in XP and Windows 2003 Server

2005-03-24 Thread Kiran VM
Hello,

I have an MFC program that access a file in the samba (3.0.10) share
with the following code.

CString strSearchPath = _T(TestServer\\TestShare\\tempfile.txt);
CStdioFile fValueFile;
if( !fValueFile.Open(strSearchPath,CFile::modeReadWrite  ) )
{
coutGetLastError()endl;
}
else
{
coutOpenedendl;
}

//CloseHandle( (HANDLE)fValueFile.m_hFile );
fValueFile.Close();

If i run this code on a Windows 2003 server, it leaves one HANDLE
open. but if i try this operation from a windows XP ( with SP2) 
machine, every thing is fine.

Also this leak seems to happen only for a samba share. If the
strSearchPath is replaced with a Windows share, there is no leak.

Number of files opened by our application is quite large and so may
handles ( in 1000s ) are held up by the application. With the help of
procexp utility i found that the handle used was a file handle
(\\TestServer\\TestShare\ wrt to the sample code above. file name was
not shown).

Did any one face a similar problem?

Any idea whether this problem is Samba related (since this happens
only for samba shares)  ?

Any help/pionter in this regard will be of great help.

With best regards,
Kiran

PS: My smb.conf is given below

[global]
workgroup = NMUSOL
netbios name = TestServer
interfaces = 132.186.71.238
bind interfaces only = Yes
security = DOMAIN
password server = 132.186.70.122
log level = 2
ldap ssl = no
kernel oplocks = no


[TestShare]
path = /export/home1/TestShare
read only = No
oplocks = no
strict locking = yes
level2 oplocks = no
-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/listinfo/samba


Re: [Samba] Different behaviour of samba share in XP and Windows 2003 Server

2005-03-24 Thread Kiran VM
On Thu, 24 Mar 2005 08:38:09 -0600, Gerald (Jerry) Carter
[EMAIL PROTECTED] wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 Kiran VM wrote:
 | Hello,
 |
 | I have an MFC program that access a file in the samba (3.0.10) share
 | with the following code.
 |
 |   CString strSearchPath = _T(TestServer\\TestShare\\tempfile.txt);
 |   CStdioFile fValueFile;
 |   if( !fValueFile.Open(strSearchPath,CFile::modeReadWrite  ) )
 |   {
 |   coutGetLastError()endl;
 |   }
 |   else
 |   {
 |   coutOpenedendl;
 |   }
 |
 |   //CloseHandle( (HANDLE)fValueFile.m_hFile );
 |   fValueFile.Close();
 |
 | If i run this code on a Windows 2003 server, it leaves one HANDLE
 | open. but if i try this operation from a windows XP ( with SP2)
 | machine, every thing is fine.
 |
 | Also this leak seems to happen only for a samba share. If the
 | strSearchPath is replaced with a Windows share, there is no leak.
 
 Could you retest against 3.0.13 and let me know if this is still
 an issue ?
 
 cheers, jerry


Hello Jerry,

I just now compiled and installed 3.0.13. But the result is the same.
Any idea why this is happening?

Thanks in advance for your help,
Kiran
-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/listinfo/samba


[Samba] Re: Different behaviour of samba share in XP and Windows 2003 Server

2005-03-24 Thread Kiran VM
Hello Jerry,

No CloseHandle() call is made in both the case. CFile (or for that
reason CStdioFile) Close() method will close the OS file handle.
(closehandle() in the sample code is commented given can be ignored)

Just to make it a bit more clearer, the executable (for testing i just
put the sample code above inside a for loop of 1000) is run from a
win2k3 server and xp machine. XP shows no handle increase leak (handle
count of 85), but in Win2k3 the handle count was around 1085 ( for
1000 iterations). This information i got from the windows task
manager. Upon this, i tried the procexp tool from sysinternals. This
clearly showed that the Handle being leaked is a file handle,
\\TestServer\TestShare in our case. (This is not the file as such but
the directory).

BTW, my samba server is on Solaris 9.

Please let me know if you erquire any further information...

Thanx,
Kiran


On Thu, 24 Mar 2005 09:52:20 -0600, Gerald (Jerry) Carter
[EMAIL PROTECTED] wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 Kiran VM wrote:
 
 ||   CString strSearchPath =
 _T(TestServer\\TestShare\\tempfile.txt);
 ||   CStdioFile fValueFile;
 ||   if( !fValueFile.Open(strSearchPath,CFile::modeReadWrite  ) )
 ...
 ||   //CloseHandle( (HANDLE)fValueFile.m_hFile );
 ||   fValueFile.Close();
 |
 | Hello Jerry,
 |
 | I just now compiled and installed 3.0.13. But the result is the same.
 | Any idea why this is happening?
 
 Nope.  Just to make sure I understand the issue.  With a Samba
 file share you have to explicitly include the call to CloseHandle()
 where as on a 2k3 file server, the Close() method handles it all
 right?  How do you know you're leaking handles here ?  e.g. what
 tool are you using ?
 
 We'll probably need to look at raw network traces between the same test
 program run against 2k3 and Samba file servers.
 
 
 
 cheers, jerry
 =
 Alleviating the pain of Windows(tm)  --- http://www.samba.org
 GnuPG Key- http://www.plainjoe.org/gpg_public.asc
 I never saved anything for the swim back. Ethan Hawk in Gattaca
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.2.5 (GNU/Linux)
 Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
 
 iD8DBQFCQuI0IR7qMdg1EfYRAgz7AJwNdN4IQdVE3cPHYLz+cXMqxDtnEgCfeisM
 UPpJwi+pVmxW/VMfLj0zapk=
 =edpH
 -END PGP SIGNATURE-

-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/listinfo/samba


[Samba] Small correction in SAMBA-HowTo-Collection

2005-03-22 Thread Kiran VM
Hello John,

In chapter 14 File and record locking an example configuration is
given for disabling the Oplocks

quote
You can disable oplocks on a per-share basis with the following: 


 
[acctdata] 
oplocks = False 
level2 oplocks = False 
un-quote

Shouldnt it be No instead of False In both the cases? I have Samba
3.0.11 installed so not sure if this is corrected in 3.0.12

Thanks and best regards,
Kiran
-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/listinfo/samba


Re: [Samba] running two servers with one install

2005-03-16 Thread Kiran VM
Hello,

I think this is possible. You need to have different config files for
each instance of samba . Its better to have different directories
for each instance ( say /opt/samba/Inst1 and /opt/samba/Inst2 ) and
have instance specifc directories like var ,lib, logs, private,
shares, var/locks inside each of them. The smb.conf also need to be
modified accordingly for each instance. Also the startup script should
be modified to start the demons for both these instances specifying
the correct config files.

Hope this helps,
bye,
Kiran


On Tue, 15 Mar 2005 16:12:46 +0100, Rainer Bendig aka Ny [EMAIL PROTECTED] 
wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 Hi there,
 
 i want to run two samba servers on the same machine. How can i do
 this? Is there any example.conf file for such a thing? Is it possible
 to set them up in one config file?
 Samba is there in version 3.0.10
 - --
 - -
 Rainer Bendig aka Ny |  http://www.moins.de  | GnuPG-Key 0x41D44F10
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.9.16-cvs (GNU/Linux)
 
 iD8DBQFCNvttWmkXC0TkjEgRAsSLAKCMg80gEAoHS+VwgcBns4ZrwgADggCeK7CD
 bI0KDXATEZN4kAMfuCUXfRs=
 =u666
 -END PGP SIGNATURE-
 --
 To unsubscribe from this list go to the following URL and read the
 instructions:  https://lists.samba.org/mailman/listinfo/samba

-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/listinfo/samba