]> git.pld-linux.org Git - packages/samba.git/blame - smb.init
- up to 2.2.7a (LFS support & minor bugfixes)
[packages/samba.git] / smb.init
CommitLineData
c9815d06 1#!/bin/sh
ba584e6e 2#
c9815d06 3# chkconfig: 345 91 35
4# description: Starts and stops the Samba smbd and nmbd daemons \
5# used to provide SMB network services.
6#
7# config: /etc/samba/smb.conf
8# config: /etc/samba/lmhosts
ba584e6e 9
10export PATH=/bin:/sbin:/usr/bin:/usr/sbin
11
12# Source function library.
13. /etc/rc.d/init.d/functions
14
15# Source networking configuration.
16. /etc/sysconfig/network
17
18# Demon specified configuration.
19. /etc/sysconfig/samba
20
21# Check that networking is up.
ecefb8c7 22if is_no "${NETWORKING}"; then
23 msg_Network_Down smb
24 exit 1
25fi
564d701c
AF
26
27TMPDIR="/tmp"; export TMPDIR
ba584e6e 28
29# Check that smb.conf exists.
30[ -f /etc/samba/smb.conf ] || exit 0
31
32# See how we were called.
33case "$1" in
34 start)
ecefb8c7 35 # Check if the service is already running?
36 if [ ! -f /var/lock/subsys/smb ]; then
37 msg_starting smbd
38 daemon $NICELEVEL smbd -D
39 msg_starting nmbd
40 daemon $NICELEVEL nmbd -D
caac7426 41 if [ "$WINBINDD" = "yes" ]; then
adf65709
PG
42 msg_starting winbindd
43 daemon $NICELEVEL winbindd
44 fi
ecefb8c7 45 RETVAL=$?
46 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/smb
47 else
48 msg_Already_Running smb
49 exit 1
50 fi
ba584e6e 51 ;;
52 stop)
ecefb8c7 53 # Stop daemons.
54 if [ -f /var/lock/subsys/smb ]; then
55 msg_stopping smbd
56 killproc smbd
57 msg_stopping nmbd
58 killproc nmbd
caac7426 59 if [ "$WINBINDD" = "yes" ]; then
adf65709
PG
60 msg_stopping winbindd
61 killproc winbindd
62 fi
ecefb8c7 63 rm -f /var/lock/subsys/smb >/dev/null 2>&1
64 else
65 msg_Not_Running smb
66 exit 1
67 fi
ba584e6e 68 ;;
69 status)
70 status smbd
71 status nmbd
229db67a 72 status winbindd
ba584e6e 73 smbstatus
ecefb8c7 74 exit $?
ba584e6e 75 ;;
76 restart)
77 $0 stop
78 $0 start
79 ;;
5b5c4a11 80 reload)
ecefb8c7 81 if [ -f /var/lock/subsys/smb ]; then
4bdfabcc 82 msg_reloading smb
ecefb8c7 83 killproc smbd -HUP
84 else
85 msg_Not_Running smb
86 exit 1
87 fi
5b5c4a11 88 ;;
ba584e6e 89 *)
ecefb8c7 90 msg_Usage "$0 {start|stop|restart|reload|status}"
ba584e6e 91 exit 1
92esac
93
ecefb8c7 94exit $RETVAL
This page took 0.054302 seconds and 4 git commands to generate.