Merge latest fixes from the release tree for WHATSNEW.txt
[Samba/gebeck_regimport.git] / packaging / RedHat / winbind.init
blob1635dca93be098f3bf4c7fc05490d01d9bae182d
1 #!/bin/sh
3 # chkconfig: 345 91 45
4 # description: Starts and stops the Samba winbind daemon to provide \
5 # user and group information from a domain controller to linux.
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 CONFIG=/etc/samba/smb.conf
24 # Check that smb.conf exists.
25 [ -f $CONFIG ] || exit 0
27 start() {
28 echo -n "Starting Winbind services: "
29 RETVAL=1
30 if [ "`egrep -i '(idmap.*uid|winbind.*uid)' $CONFIG | egrep -v [\#\;]`" ]; then
31 daemon winbindd
32 RETVAL=$?
34 echo
35 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/winbind || \
36 RETVAL=1
37 return $RETVAL
39 stop() {
40 echo -n "Shutting down Winbind services: "
41 RETVAL=1
42 if [ "`egrep -i '(idmap.*uid|winbind.*uid)' $CONFIG | egrep -v [\#\;]`" ]; then
43 killproc winbindd
44 RETVAL=$?
46 echo
47 [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/winbind
48 return $RETVAL
50 restart() {
51 stop
52 start
54 reload() {
55 export TMPDIR="/var/tmp"
56 echo -n "Checking domain trusts: "
57 killproc winbindd -HUP
58 RETVAL=$?
59 echo
60 return $RETVAL
62 mdkstatus() {
63 status winbindd
66 case "$1" in
67 start)
68 start
70 stop)
71 stop
73 restart)
74 restart
76 reload)
77 reload
79 status)
80 mdkstatus
82 condrestart)
83 [ -f /var/lock/subsys/winbindd ] && restart || :
86 echo "Usage: $0 {start|stop|restart|status|condrestart}"
87 exit 1
88 esac
90 exit $?