SAMBA startup script.

Dan Nicholson dbn.lists at gmail.com
Wed Feb 21 14:00:29 PST 2007


On 2/21/07, Joris Piepers <joris.piepers at gmail.com> wrote:
> I'm not sure if it is the right place to ask these questions;
> but when I start Samba I get:
>
> Stopping smbd...                                                    [ OK  ]
> Stopping nmbd...                                                    [FAILED]
> Starting nmbd...                          Already running     [ ATTN ]
> Starting smbd...                                                     [ OK  ]
>
> Also when I close LFS-6.2 it still keeps hanging on this failure.
>
> This is my samba script:
>
> #!/bin/bash
> source /etc/sysconfig/rc
> source $rc_functions
> case "$1" in
>                  start)
>                  echo "Starting nmbd..."
>                  loadproc /usr/sbin/nmbd -D
>                  echo "Starting smbd..."
>                  loadproc /usr/sbin/smbd -D
>                  ;;
>          stop)
>                  echo "Stopping smbd..."
>                  killproc /usr/sbin/smbd
>                  echo "Stopping nmbd..."
>                  killproc /usr/sbin/nmbd
>                  ;;
>          reload)
>                  echo "Reloading smbd..."
>                  reloadproc /usr/sbin/smbd
>                  echo "Reloading nmbd..."
>                  reloadproc /usr/sbin/nmbd
>                  ;;
>          restart)
>                  $0 stop
>                  sleep 1
>                  $0 start
>                  ;;
>          status)
>                  statusproc /usr/sbin/nmbd
>                  statusproc /usr/sbin/smbd
>                  ;;
>          *)
>                  echo "Usage: $0
> {start|stop|reload|restart|status}"
>                  exit 1
>                  ;;
> esac
>
> In the directory /var/run the pid is not removed. After executing
> /etc/rc.d/init.d/samba stop
>
> Stopping smbd...                                                    [ OK  ]
> Stopping nmbd...                                                    [FAILED]
> Starting nmbd...                          Already running     [ ATTN ]
> Starting smbd...                                                     [ OK  ]
>
> ls -l /var/run | grep nmbd
> -rw-r--r--    1 root     root           21 Feb 11:42 nmbd.pid

I suspect this is a bootscript issue, but I really don't know how the
samba setup goes. The first question to answer is why nmbd is failing
to stop. So, instead of executing the bootscript, just shut things
down manually. Please substitute the right paths if I've gotten them
wrong.

$ smbd_pid=`cat /var/run/smbd.pid`
$ kill -TERM $smbd_pid

Did smbd die? Does the pid file still exist?

$ nmbd_pid=`cat /var/run/nmbd_pid`
$ kill -TERM $nmbd_pid

Did nmbd die? Does the pid file still exist? If it didn't get killed,
then the pid file shouln't be removed.

If it didn't die, then you might want to restart nmbd from the command
line without the -D switch. Maybe you should also turn up the
debugging with -d. Then try the same procedure with `kill -TERM' on
your running process.

--
Dan



More information about the blfs-support mailing list