Samba frustrations on reboot... fix!

Jeff Campbell jcampbell at ins-msi.com
Wed Jan 23 04:18:35 GMT 2002


Jeff Campbell wrote:
> "John E. Malmberg" wrote:
> > "Zane H. Healy" wrote:
> > >
> > > OK, I've got a definite hate/hate relationship going on here with Samba.
> > > I've got it installed on the DEC 3000/300LX that acts as a fileserver for
> > > my hobbyist cluster.
> > >
> > > Every time the system has to be rebooted I've got to run the Samba install
> > > script.  Looking through INSTALL.COM, I can't see anything it's doing that
> > > @SYS$STARTUP:SAMBA_STARTUP doesn't do, but the fact remains it's the
> > > *only* way I've found to get Samba to work.  If I don't do this, I can't
> > > access the machine from Windoz (not a big loss, but I do have one laptop
> > > here that runs it for a couple legacy apps and it's nice to be able to put
> > > files on my common scratch disk).
> >
> > First of all, what version of SAMBA for VMS is being used here?
> >
> > If it is the 2.0.3 BETA:
> >
> > It appears from inspecting INSTALL.COM that it sets up system wide logical
> > names that are needed for SAMBA-VMS.  It also installs a CRTL wrapper shared
> > image.
> >
> > The SAMBA_STARTUP.COM seems to just startup the NMBD process.
>
> As you note above it defines logical names, including SAMBA_ROOT.
> 
> I had written earlier in another reply that I had had to add a
> $ TCPIP ENAB SERV SMBD line at the bottom of SYS$STARTUP:SAMBA_STARTUP.COM.
> I think I know why now. I happened to catch an error message during TCPIP
> startup at boot time saying that the SMBD service was not started.
> 
> Looking at the TCPIP service:
> 
> $ tcpip
> TCPIP> show serv smbd /full
> 
> Service: SMBD
>                            State:     Enabled
> Port:              139     Protocol:  TCP             Address:  0.0.0.0
> Inactivity:          5     User_name: SYSTEM          Process:  SMBD
> Limit:             100     Active:      1             Peak:       2
> 
> File:         SAMBA_ROOT:[BIN]SMBD_STARTUP.COM     <<<<<<<<<<<<<<<<<<
> Flags:        Listen
> 
> Socket Opts:  Rcheck Scheck
>  Receive:            0     Send:               0
> 
> Log Opts:     Acpt Actv Dactv Conn Error Exit Logi Logo Mdfy Rjct TimO
> Addr
>  File:        SAMBA_ROOT:[VAR]SMBD_STARTUP.LOG     <<<<<<<<<<<<<<<<<<
> 
> Security
>  Reject msg:  not defined
>  Accept host: 0.0.0.0
>  Accept netw: 0.0.0.0
> TCPIP> exit
> 
> I think TCPIP is trying to open one or both of the above files but the
> logical device is not yet defined. So it bombs out. Later when
> SYS$STARTUP:SAMBA_STARTUP.COM executes the ENAB SERV command line I
> added it starts.
> 
> In my SYSTARTUP_VMS.COM, I added $@SYS$STARTUP:SAMBA_STARTUP near the
> bottom of the file, after the $@SYS$STARTUP:TCPIP$STARTUP line. So SMBD
> service is always going to fail to start. I haven't tried changing the
> order in which the two startup command files are executed as I expect the
> NMBD process requires TCP sockets to start. Chicken and egg.
> 
> I don't know that Zane isn't seeing another problem but I'll bet his
> rerunning the INSTALL procedure is masking the SMBD service not
> automatically starting up as intended.
> >
> > -John
> > wb8tyw at qsl.network
> 
> Jeff Campbell
> n8wxs at arrl.net

I think I have the solution to the above observed problem. The fix I
suggested above only addresses half the problem.

The real 'problem' is in SAMBA_ROOT:[BIN]SMBD_SETUP_TCPIP.COM. This
file is normally executed only once, during installation. This is
because the command UCX SET CONFIGURATION ENABLE SERVICE SMBD only
needs to be issued once. Once this command is executed, the SMBD
service will be automatically started when TCPIP is started during
a boot. We know this automatic startup does not work.

A UCX ENABLE SERVICE SMBD command is also executed in the setup
command file. This is why Zane's re-running INSTALL.COM fixed it for
him. It calls the setup file which re-issues both commands each time
he ran it.

I think SMBD_SETUP_TCPIP.COM needs to have these two lines either
commented out or removed:

   $ UCX SET CONFIGURATION ENABLE SERVICE SMBD
   $ UCX ENABLE SERVICE SMBD

Removing the first will solve the automatic startup problem by not
trying to do that. ("Doctor, Doctor..."  8-)

The second line should be moved to SYS$SYSTARTUP:SAMBA_STARTUP.COM
as I suggested above, which will allow SMBD to be started after
TCPIP is up.

I have modified my copies of SAMBA_STARTUP.COM by adding the following:

   ...
   $! Start NMBD
   $!
   $! First, check to see if service smbd is known to tcpip.
   $
   $ defi/user sys$output nl:
   $ defi/user sys$error  nl:
   $
   $ tcpip show service smbd
   $
   $ if .not. $status
   $ then
   $	@samba_root:[bin]smbd_setup_tcpip.com
   $ endif
   $!
   $ run/detached -
   ...

And the last line:

   $ tcpip enable service smbd

SAMBA now restarts across boots, including ones after I've deleted and
recreated TCPIP's database files (I hate BIND).

Jeff Campbell
n8wxs at arrl.net




More information about the samba-vms mailing list