Jeremy Allison
1998-Sep-15 16:48 UTC
SUNOS: Samba grabs all semaphores, breaking other softwares (PR#9755)
Ole.H.Nielsen@fysik.dtu.dk wrote:> > SAMBA grabs ALL available semaphores minus 1 on SunOS 4.1.3, > where the kernel has 60, see /usr/include/sys/sem.h: > #define SEMMNS 60 /* # of semaphores in system */ > > This is a MAJOR PROBLEM to us, since our backup software > (IBM ADSM) also needs available semaphores for the client > part to work. Hence we can choose between running SAMBA > or running backups :-(Hi Ole, nice to hear from you again.> > On AIX 4.2.1 we see just 1 or 2 semaphores taken by SAMBA, > so this is a SunOS specific problem. We'd really like to > get this bug under control... >It's not actually a bug really, more a questionable design decision. The solution for Samba 1.9.18pXX is to set the number of semaphores manually in shmem_sysv.c, ie. change the lines: #ifdef SEMMSL #define SHMEM_HASH_SIZE (SEMMSL-1) #else #define SHMEM_HASH_SIZE 63 #endif to be just : #define SHMEM_HASH_SIZE <whatever you want here> Samba-2 won't have this problem as it is much more conservative about SYSV semaphore use. I'm CC:ing this reply to the mailing list as I think people might be interested in this answer. Cheers, Jeremy Allison, Samba Team. -- -------------------------------------------------------- Buying an operating system without source is like buying a self-assembly Space Shuttle with no instructions. --------------------------------------------------------
Ole Holm Nielsen
1998-Sep-16 11:12 UTC
SUNOS: Samba grabs all semaphores, breaking other softwares (PR#9755)
-- Jeremy Allison wrote:> > SAMBA grabs ALL available semaphores minus 1 on SunOS 4.1.3, > > where the kernel has 60, see /usr/include/sys/sem.h: > > #define SEMMNS 60 /* # of semaphores in system */...> The solution for Samba 1.9.18pXX is to set the number > of semaphores manually in shmem_sysv.c, ie. change > the lines: > > #ifdef SEMMSL > #define SHMEM_HASH_SIZE (SEMMSL-1) > #else > #define SHMEM_HASH_SIZE 63 > #endif > > to be just : > > #define SHMEM_HASH_SIZE <whatever you want here>I added this bit of code after the above lines in shmem_sysv.c: #ifdef SUNOS4 /* Do not grab all available semaphores (64) on SunOS 4 */ #undef SHMEM_HASH_SIZE #define SHMEM_HASH_SIZE 10 #endif Now SAMBA grabs only 11 out of 64 available (by default) semaphores, and I'm happy again :-) ADSM backup works for us once again, now that there are available semaphores. Developers: How about adding this hack to the main 1.9.18 code ? It's really a problem on SunOS 4. Best regards, Ole Holm Nielsen Department of Physics, Building 307 Technical University of Denmark, DK-2800 Lyngby, Denmark