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
10 export PATH=/bin:/sbin:/usr/bin:/usr/sbin
12 # Source function library.
13 . /etc/rc.d/init.d/functions
15 # Source networking configuration.
16 . /etc/sysconfig/network
18 # Demon specified configuration.
19 . /etc/sysconfig/samba
21 # Check that networking is up.
22 if is_yes "${NETWORKING}"; then
23 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
31 TMPDIR="/tmp"; export TMPDIR
33 # Check that smb.conf exists.
34 [ -f /etc/samba/smb.conf ] || exit 0
37 # See how we were called.
40 # Check if the service is already running?
41 if [ ! -f /var/lock/subsys/smb ]; then
47 [ $RETVAL -eq 0 ] && RETVAL=$?
48 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/smb
50 msg_already_running smb
55 if [ -f /var/lock/subsys/smb ]; then
60 rm -f /var/lock/subsys/smb >/dev/null 2>&1
70 [ $RETVAL -eq 0 ] && RETVAL=$RET
79 if [ -f /var/lock/subsys/smb ]; then
84 msg_not_running smb >&2
89 msg_usage "$0 {start|stop|restart|reload|force-reload|status}"