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
47 [ $RETVAL -eq 0 ] && RETVAL=$?
48 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/smb
50 msg_already_running smb
56 if [ -f /var/lock/subsys/smb ]; then
61 rm -f /var/lock/subsys/smb >/dev/null 2>&1
68 # See how we were called.
81 [ $RETVAL -eq 0 ] && RETVAL=$RET
89 if [ -f /var/lock/subsys/smb ]; then
99 msg_usage "$0 {start|stop|restart|reload|force-reload|status}"