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
35 # Check that smb.conf exists.
36 [ -f /etc/samba/smb.conf ] || exit 0
39 # See how we were called.
42 # Check if the service is already running?
43 if [ ! -f /var/lock/subsys/smb ]; then
49 [ $RETVAL -eq 0 ] && RETVAL=$?
50 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/smb
52 msg_already_running smb
57 if [ -f /var/lock/subsys/smb ]; then
62 rm -f /var/lock/subsys/smb >/dev/null 2>&1
72 [ $RETVAL -eq 0 ] && RETVAL=$RET
81 if [ -f /var/lock/subsys/smb ]; then
86 msg_not_running smb >&2
91 msg_usage "$0 {start|stop|restart|reload|force-reload|status}"