4 # description: Starts and stops the Samba smbd and nmbd daemons \
5 # used to provide SMB network services.
7 # config: /etc/samba/smb.conf
8 # config: /etc/samba/lmhosts
12 export PATH=/bin:/sbin:/usr/bin:/usr/sbin
14 # Source function library.
15 . /etc/rc.d/init.d/functions
17 # Source networking configuration.
18 . /etc/sysconfig/network
20 # Demon specified configuration.
21 . /etc/sysconfig/samba
23 # Check that networking is up.
24 if is_yes "${NETWORKING}"; then
25 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
33 TMPDIR="/tmp"; export TMPDIR
36 # Check that smb.conf exists.
37 [ -f /etc/samba/smb.conf ] || exit 0
40 # Check if the service is already running?
41 if [ ! -f /var/lock/subsys/smb ]; then
43 daemon /usr/sbin/smbd -D
46 daemon /usr/sbin/nmbd -D
47 [ $RETVAL -eq 0 ] && RETVAL=$?
48 if [ $RETVAL -eq 0 ]; then
49 touch /var/lock/subsys/smb
52 msg_already_running smb
58 if [ -f /var/lock/subsys/smb ]; then
63 rm -f /var/lock/subsys/smb >/dev/null 2>&1
70 # See how we were called.
83 [ $RETVAL -eq 0 ] && RETVAL=$RET
91 if [ -f /var/lock/subsys/smb ]; then
101 msg_usage "$0 {start|stop|restart|reload|force-reload|status}"