LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-28-2005, 06:31 AM   #1
SBFree
Member
 
Registered: Nov 2004
Distribution: Ubuntu
Posts: 70

Rep: Reputation: 15
Samba Won't start or stop


Well I mucked up something and I can't start or stop Samba. I get the following messages:

Executing /etc/rc.d/init.d/smb start ..
/bin/sh: line 1: /etc/rc.d/init.d/smb: Permission denied


Executing /etc/rc.d/init.d/smb stop ..
/bin/sh: line 1: /etc/rc.d/init.d/smb: Permission denied

I am using WebMin to control the machine remotely and looking at SMB in the Bootup section it reports that it's running status is unknown.

WebMin appears to run the following to start/stop SMB:
#!/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

RETVAL=0


start() {
KIND="SMB"
echo -n $"Starting $KIND services: "
daemon smbd $SMBDOPTIONS
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
}


# Allow status as non-root.
if [ "$1" = status ]; then
rhstatus
exit $?
fi

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



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 suggestions where to start to debug?
Thanks.
 
Old 12-28-2005, 08:08 AM   #2
cconstantine
Member
 
Registered: Dec 2005
Distribution: RedHat, Ubuntu
Posts: 101

Rep: Reputation: 15
I don't run SMB. But most of the init scripts need to be run as root. So if you have some GUI interface you're using as a non-root user, then it either uses some setuid program to run the init script, or it uses sudo to run the script...

But really, I'd expect Samba to start a boot -- it's probably just a matter of dropping to a shell and doing a "sudo /etc/init.d/smb start". And perhaps figuring out why smb didn't start on your last boot.

-c
 
  


Reply



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
Start/stop remote Windows services with Samba Xnake Linux - Networking 3 09-03-2005 12:08 PM
Start/stop services on start-up koyi Slackware 5 08-04-2003 08:20 AM
cupsd won't stop, won't start ?! jkcunningham Linux - General 0 06-19-2003 08:14 AM
start and stop services log Linux - General 7 03-21-2003 08:29 PM
when i restart SAMBA,it says:stop samba failed,start SAMBA OK! whepin Linux - Networking 3 12-26-2001 05:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:42 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