4 # description: Starts and stops the Samba smbd and nmbd daemons \
5 # used to provide SMB network services.
7 # Source function library.
8 if [ -f /etc
/init.d
/functions
] ; then
9 .
/etc
/init.d
/functions
10 elif [ -f /etc
/rc.d
/init.d
/functions
] ; then
11 .
/etc
/rc.d
/init.d
/functions
16 # Source networking configuration.
17 .
/etc
/sysconfig
/network
19 # Check that networking is up.
20 [ ${NETWORKING} = "no" ] && exit 0
22 # Check that smb.conf exists.
23 [ -f /etc
/samba
/smb.conf
] ||
exit 0
29 # If CUPS is used as printing system, reload smb after a 1 minute delay
30 # to allow the printers to appear properly as samba shares.
31 if killall
-0 cupsd
2>/dev
/null
; then
32 ( sleep 60 && killproc smbd
-HUP 1>/dev
/null
) &
34 export TMPDIR
="/var/tmp"
35 echo -n "Starting SMB services: "
39 echo -n "Starting NMB services: "
43 [ $RETVAL -eq 0 -a $RETVAL2 -eq 0 ] && touch /var
/lock
/subsys
/smb || \
48 echo -n "Shutting down SMB services: "
52 echo -n "Shutting down NMB services: "
55 [ $RETVAL -eq 0 -a $RETVAL2 -eq 0 ] && rm -f /var
/lock
/subsys
/smb
64 export TMPDIR
="/var/tmp"
65 echo -n "Reloading smb.conf file: "
93 [ -f /var
/lock
/subsys
/smb
] && restart ||
:
96 echo "Usage: $0 {start|stop|restart|status|condrestart}"