LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 08-09-2003, 03:20 AM   #1
pnh73
Member
 
Registered: Jul 2003
Location: Birmingham, UK
Distribution: Ubuntu,Debian
Posts: 381

Rep: Reputation: 30
Question Samba Starting problem


When I use the command 'smb start' to load the samba servers then i get an error when it trys to start smbd. I get:


However when i just start it using the command 'smbd' then it works fine. Does anyone have any idea why this is happening?? Here is a copy of the /etc/rc.d/init.d/smb script:

Quote:
#!/bin/sh
#
# chkconfig: - 91 35
# description: Starts and stops the Samba smbd and nmbd daemons \
# used to provide SMB network services.
#
# pidfile: /var/run/samba/smbd.pid
# pidfile: /var/run/samba/nmbd.pid
# config: /etc/samba/smb.conf


# Source function library.
if [ -f /etc/init.d/functions ] ; then
. /etc/init.d/functions
elif [ -f /etc/rc.d/init.d/functions ] ; then
. /etc/rc.d/init.d/functions
else
exit 0
fi

# Avoid using root's TMPDIR
unset TMPDIR

# Source networking configuration.
. /etc/sysconfig/network

if [ -f /etc/sysconfig/samba ]; then
. /etc/sysconfig/samba
fi

# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0

# Check that smb.conf exists.
[ -f /etc/samba/smb.conf ] || exit 0

# Check that we can write to it... so non-root users stop here
[ -w /etc/samba/smb.conf ] || exit 0


RETVAL=0


start() {
KIND="SMB"
echo -n $"Starting $KIND services: "
daemon sm $ BDOPTIONS
RETVAL=$?
echo
KIND="NMB"
echo -n $"Starting $KIND services: "
daemon nmbd $NMBDOPTIONS
RETVAL2=$?
echo
[ $RETVAL -eq 0 -a $RETVAL2 -eq 0 ] && touch /var/lock/subsys/smb || \
RETVAL=1
return $RETVAL
}

stop() {
KIND="SMB"
echo -n $"Shutting down $KIND services: "
killproc smbd
RETVAL=$?
echo
KIND="NMB"
echo -n $"Shutting down $KIND services: "
killproc nmbd
RETVAL2=$?
[ $RETVAL -eq 0 -a $RETVAL2 -eq 0 ] && rm -f /var/lock/subsys/smb
echo ""
return $RETVAL
}

restart() {
stop
start
}

reload() {
echo -n $"Reloading smb.conf file: "
killproc smbd -HUP
RETVAL=$?
echo
return $RETVAL
}

rhstatus() {
status smbd
status nmbd
}

case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
reload)
reload
;;
status)
rhstatus
;;
condrestart)
[ -f /var/lock/subsys/smb ] && restart || :
;;
*)
echo $"Usage: $0 {start|stop|restart|reload|status|condrestart}"
exit 1
esac

exit $?
Any help is much appreciated.

Paul
------
I am note sure wich is worse, my spreling or my prof reding.
 
Old 08-09-2003, 04:39 AM   #2
sanw2k
Member
 
Registered: Apr 2002
Location: bangy
Distribution: rh 9,,Mandy 9.1, Lycoris
Posts: 42

Rep: Reputation: 15
it may help u

I am not sure this may help u but why cant u compare my smb script with urs

#!/bin/sh
#
# chkconfig: 345 91 35
# description: Starts and stops the Samba smbd and nmbd daemons \
# used to provide SMB network services.

# Source function library.
. /etc/rc.d/init.d/functions

# Source networking configuration.
. /etc/sysconfig/network

# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0

CONFIG=/etc/samba/smb.conf

# Check that smb.conf exists.
[ -f $CONFIG ] || exit 0

# See how we were called.
case "$1" in
start)
echo -n "Starting SMB services: "
daemon smbd -D
daemon nmbd -D
echo
touch /var/lock/subsys/smb
;;
stop)
echo -n "Shutting down SMB services: "

## we have to get all the smbd process here instead of just the
## main parent (i.e. killproc) because it can take a long time
## for an individual process to process a TERM signal
smbdpids=`ps guax | grep smbd | grep -v grep | awk '{print $2}'`
for pid in $smbdpids; do
kill -TERM $pid
done
## nmbd is ok to kill using killproc()
killproc nmbd -TERM
rm -f /var/lock/subsys/smb
echo ""
;;
status)
status smbd
status nmbd
;;
restart)
echo -n "Restarting SMB services: "
$0 stop
$0 start
echo "done."
;;
*)
echo "Usage: smb {start|stop|restart|status}"
exit 1
esac
 
Old 08-20-2003, 12:06 PM   #3
pnh73
Member
 
Registered: Jul 2003
Location: Birmingham, UK
Distribution: Ubuntu,Debian
Posts: 381

Original Poster
Rep: Reputation: 30
I dont have any experience with scripts unfortunately. Also my script seems to the same thing, from what my programming experience shows me, but in a different manner. I dont understand why this is happening!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
problem with starting Samba service honghebox Linux - Newbie 6 01-03-2006 11:20 PM
Problem starting Samba Service on Mandrake 9 Box StewieG Linux - Networking 3 05-15-2005 12:38 AM
Starting Samba agallant AIX 7 10-31-2004 06:30 AM
Samba problem (while starting) koy Linux - Networking 6 04-16-2003 05:19 AM
Starting Samba AMDPwred Linux - General 5 01-27-2002 11:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 07:04 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration