making sure all the /etc/samba paths are consistent
[Samba.git] / packaging / Mandrake / smb.init
blob8855f04efba95f5efaa312a34f0c73823159bf44
1 #!/bin/sh
3 # chkconfig: - 91 35
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
12 else
13 exit 0
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
25 RETVAL=0
28 start() {
29 echo -n "Starting SMB services: "
30 daemon smbd -D
31 RETVAL=$?
32 echo
33 echo -n "Starting NMB services: "
34 daemon nmbd -D
35 RETVAL2=$?
36 echo
37 [ $RETVAL -eq 0 -a $RETVAL2 -eq 0 ] && touch /var/lock/subsys/smb || \
38 RETVAL=1
39 return $RETVAL
41 stop() {
42 echo -n "Shutting down SMB services: "
43 killproc smbd
44 RETVAL=$?
45 echo
46 echo -n "Shutting down NMB services: "
47 killproc nmbd
48 RETVAL2=$?
49 [ $RETVAL -eq 0 -a $RETVAL2 -eq 0 ] && rm -f /var/lock/subsys/smb
50 echo ""
51 return $RETVAL
53 restart() {
54 stop
55 start
57 reload() {
58 echo -n "Reloading smb.conf file: "
59 killproc smbd -HUP
60 RETVAL=$?
61 echo
62 return $RETVAL
64 mdkstatus() {
65 status smbd
66 status nmbd
69 case "$1" in
70 start)
71 start
73 stop)
74 stop
76 restart)
77 restart
79 reload)
80 reload
82 status)
83 mdkstatus
85 condrestart)
86 [ -f /var/lock/subsys/smb ] && restart || :
89 echo "Usage: $0 {start|stop|restart|status|condrestart}"
90 exit 1
91 esac
93 exit $?