[Samba] Need Help: Sometimes Stop during smbd start

Joel Hammer Joel at HammersHome.com
Fri Aug 30 07:56:02 GMT 2002


The startup scripts that come with the distributions are amazingly
complicated. Yours seems straightforward but I suspect if you looked
at the program which actually starts up smbd (startproc), you'd be
surprised by the complexity.  (And, what is rc_status -v anyway?) This
simple script, which is really more than the computer needs at startup,
works fine.

#!/bin/bash
case "$1" in
 start)        
  killall smbd
  killall nmbd
/usr/local/samba/bin/smbd -D
/usr/local/samba/bin/nmbd -D
  ;;
 stop)
  killall smbd
  killall nmbd
 ;;
 reload)
 kill -SIGHUP `cat /usr/local/samba/var/locks/smbd.pid`
 kill -SIGHUP `cat /usr/local/samba/var/locks/nmbd.pid`
 ;;
 *)
 echo Usage: 
 echo start stop reload
 ;;
esac
exit 0

Now, the paths on your machine are different, and are contained in the
variables defined at the start of your script.
I would try this simple script, and you can put in troubleshooting echo's
at appropriate places. This shouldn't be too hard to track down.
Joel


On Thu, Aug 29, 2002 at 09:28:43PM +0200, Bernhard Schättin wrote:
> Hi
> 
> during Startup of  SuSE-Linux 7.2 Prof. the PC is sometimes
> ( 1 of 10 times) stopping by start smbd. Reset knop the help
> only. I have this problem with the samba version in SuSE
> package and version 2.2.5 too. In the file ../rc3.d/S12smb I
> added 2 lines to see if nmbd and smbd are startet.
> I see nmbd is starting always, the text "SAMBA smbd
> gestartet" is in case of fault not printing.
> Do you know the problem and have you a solution? Which
> modification can I do for more information (you must know,
> no more text at monitor available and I must reset the PC)
> 
> PC:  Pentium II 200MHz System with 40MB RAM
> 
> thank you for your helps
> Bernhard schaettin

> #! /bin/sh
> # Copyright (c) 2001 SuSE Gmbh Nueremberg, Germany. All rights reserved.
> #
> # <fedback at suse.de>
> #
> ### BEGIN INIT INFO
> # Provides:       smb
> # Required-Start: $network $remote_fs syslog 
> # Required-Stop:
> # Default-Start:  3 5
> # Default-Stop:
> # Description:    initscript for the SAMBA services
> ### END INIT INFO
> #
> # init.d/smb
> 
> . /etc/rc.config
> 
> SMB_BIN=/usr/sbin/smbd
> NMB_BIN=/usr/sbin/nmbd
> SMB_CONF=/etc/smb.conf
> SMB_PID=/var/log/locks/smbd.pid
> NMB_PID=/var/log/locks/nmbd.pid
> 
> 
> # Determine the base and follow a runlevel link name.
> base=${0##*/}
> link=${base#*[SK][0-9][0-9]}
> 
> # Force execution if not called by a runlevel directory.
> test $link = $base && START_SMB=yes
> test "$START_SMB" = "yes" || exit 0
> 
> if [ ! -x $SMB_BIN ] ; then
>        echo -n "SMB demon not installed ! "
>        exit 5
> fi
> 
> if [ ! -x $NMB_BIN ] ; then
>        echo -n "NMB demon not installed ! "
>        exit 5
> fi
> 
> 
> # The echo return value for success (defined in /etc/rc.config).
> #return=$rc_done
> 
> . /etc/rc.status
> rc_reset
> 
> 
> case "$1" in
>     start)
>         echo -n "Starting SAMBA nmbd :"
>         checkproc $NMB_BIN
>         if [ $? -eq 0 ] ; then
>           echo -n "  Warning: nmbd already running ! "
>         else
>           [ -e $NMB_PID ] && echo -n "  Warning: $NMB_PID exists ! "
>         fi
>         startproc $NMB_BIN -D
>         rc_status -v
>         echo -n "SAMBA nmbd gestartet"
>         echo -n "Starting SAMBA smbd :"
> 	checkproc $SMB_BIN
> 	if [ $? -eq 0 ] ; then
>           echo -n "  Warning: smbd already running ! "
>         else
>           [ -e $SMB_PID ] && echo -n "  Warning: $SMB_PID exists ! "
>         fi
>         startproc $SMB_BIN -D
>         rc_status -v
>         echo -n "SAMBA smbd gestartet"
>         ;;
>     stop)
>         echo -n "Shutting down SAMBA nmbd :"
> 	checkproc $NMB_BIN || echo -n "  Warning: nmbd not running ! "
> 	killproc -TERM $NMB_BIN
> 	rm $NMB_PID
> 	rc_status -v
>         echo -n "Shutting down SAMBA smbd :"
> 	checkproc $SMB_BIN || echo -n "  Warning: smbd not running ! "
> 	killproc -TERM $SMB_BIN
> 	rm $SMB_PID
> 	rc_status -v
> 	;;
>     try-restart)
>        $0 stop  &&  $0 start
>        rc_status
>        ;;
>     restart)
>        $0 stop
>        $0 start
>        rc_status
>        ;;
>     force-reload)
>        $0 reload
>        rc_status
>        ;;
>     reload)
>        echo -n "Reloading SAMBA nmbd :"
>        checkproc $NMB_BIN || echo -n "  Warning: nmbd not running ! "
>        killproc -HUP $NMB_BIN
> #      [ -e $NMB_PID ] && touch -c -m $NMB_PID
>        rc_status -v
>        echo -n "Reloading SAMBA smbd :"
>        checkproc $SMB_BIN || echo -n "  Warning: smbd not running ! "
>        killproc -HUP $SMB_BIN
> #      [ -e $SMB_PID ] && touch -c -m $SMB_PID
>        rc_status -v
>        ;;
>     status)
>        echo -n "Checking for SAMBA nmbd :"
>        checkproc $NMB_BIN
>        rc_status -v
>        echo -n "Checking for SAMBA smbd :"
>        checkproc $SMB_BIN
>        rc_status -v
>        ;;
>     probe)
>        test $SMB_CONF -nt $SMB_PID && echo reload
>        test $SMB_CONF -nt $NMB_PID && echo reload
>        ;;
>     *)
>        echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload|probe}"
>        exit 1
>        ;;
> esac
> rc_exit




More information about the samba mailing list