4 # description: Starts and stops the Samba winbind daemon to provide\
5 # user and group information from a NT domain controller to linux.
7 # config: /etc/samba/smb.conf
9 export PATH=/bin:/sbin:/usr/bin:/usr/sbin
11 # Source function library.
12 . /etc/rc.d/init.d/functions
14 # Source networking configuration.
15 . /etc/sysconfig/network
17 # Daemon specific configuration.
18 . /etc/sysconfig/winbind
20 # Check that networking is up.
21 if is_yes "${NETWORKING}"; then
22 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
23 msg_network_down winbindd
30 TMPDIR="/tmp"; export TMPDIR
32 # Check that smb.conf exists.
33 [ -f /etc/samba/smb.conf ] || exit 0
35 # return true if 'idmap uid' or 'idmap gid' is set in samba config
37 egrep -qvi '^idmap [ug]id' /etc/samba/smb.conf
41 if [ ! -f /var/lock/subsys/winbind ]; then
44 daemon /usr/sbin/winbindd
46 if [ $RETVAL -eq 0 ]; then
47 touch /var/lock/subsys/winbind
51 nls "Winbind is not configured in /etc/samba/smb.conf, not starting"
54 msg_already_running winbindd
59 if [ -f /var/lock/subsys/winbind ]; then
62 rm -f /var/lock/subsys/winbind >/dev/null 2>&1
64 msg_not_running winbindd
69 if [ -f /var/lock/subsys/winbind ]; then
73 msg_not_running winbindd
79 # See how we were called.
92 if [ -f /var/lock/subsys/winbind ]; then
93 msg_reloading winbindd
94 killproc winbindd -HUP
97 msg_not_running winbindd
109 msg_usage "$0 {start|stop|restart|try-restart|reload|force-reload|status}"