Samba on AIX

itsore08 at itsore08 at
Fri Mar 17 20:18:39 GMT 2000


Thanks for the patches, smbd and nmbd now work fine from the System
Resource Controller.

Have you also got SWAT to work under the SRC? It doesn't even run from the
command line. I guess it relies upon inetd to listen for connections and
the SRC doesn't actually listen for anything. :(

Does anyone have a hack to get SWAT to listen for it's own connections?

Steven P.

Peter Samuelson <peter at> on 03/16/2000 05:48:28 AM

To:   ITSO Resident 8/Poughkeepsie/IBM at IBMUS
Subject:  Re: Samba on AIX

> Can you please send me details of the SRC patch for Samba?

Not much to explain -- it's an extremely simple patch.  Ordinarily,
smbd and nmbd can be run two different ways: from inetd, in which case
stdin and stdout are sockets, or in standalone mode, in which case you
send in the `-D' flag.  In the case of inetd, the daemon doesn't have
to open its own connection and it isn't supposed to fork to background.
In standalone mode, the daemon *should* fork to background and it
*does* have to listen/accept its own connections.

SRC wants to run daemons in the foreground, i.e. they should *not* fork
to background.  If they do, SRC loses track of them.  In other respects
it is like standalone mode.  My patch simply adds a third valid case
for smbd and nmbd: the case where `-D' was *not* used but stdin is
*not* a socket file.  This means SRC mode.

A really clever patch would have added message queue support or
something so that `/usr/bin/refresh' would work.  Mine is not a really
clever patch.  You have to use the signals method.  (See `man mkssys'.)
I create the SRC subsystems with:

  mkssys -s smbd -p /usr/local/sbin/smbd -G local -u 0 -R -S -n 15 -f 3
  mkssys -s nmbd -p /usr/local/sbin/nmbd -G local -u 0 -R -S -n 15 -f 3

Then in a startup script I make sure to run `startsrc -g local'.


diff -urN samba-2.0.6/source/smbd/server.c.orig
--- samba-2.0.6/source/smbd/server.c.orig     Fri Jan 15 19:07:21 1999
+++ samba-2.0.6/source/smbd/server.c     Wed Mar  3 22:27:15 1999
@@ -699,11 +699,10 @@
     DEBUG(3,( "loaded services\n"));

     if (!is_daemon && !is_a_socket(0)) {
-         DEBUG(0,("standard input is not a socket, assuming -D
          is_daemon = True;

-    if (is_daemon) {
+    else if (is_daemon) {
          DEBUG( 3, ( "Becoming a daemon.\n" ) );
diff -urN samba-2.0.6/source/nmbd/nmbd.c.orig
--- samba-2.0.6/source/nmbd/nmbd.c.orig  Fri Jan 15 19:07:54 1999
+++ samba-2.0.6/source/nmbd/nmbd.c Wed Mar  3 22:27:13 1999
@@ -769,11 +769,10 @@

   if (!is_daemon && !is_a_socket(0))
-    DEBUG(0,("standard input is not a socket, assuming -D option\n"));
     is_daemon = True;

-  if (is_daemon)
+  else if (is_daemon)
     DEBUG( 2, ( "Becoming a daemon.\n" ) );

More information about the samba-technical mailing list