]> git.pld-linux.org Git - packages/samba.git/blame - winbind.init
- updated to 3.0.1rc1 (fixed hosts allow problems)
[packages/samba.git] / winbind.init
CommitLineData
f9c55e20 1#!/bin/sh
2#
3# chkconfig: 345 91 35
4# description: Starts and stops the Samba winbind daemon to provide\
5# user and group information from a NT domain controller to linux.
6#
7# config: /etc/samba/smb.conf
8
9export PATH=/bin:/sbin:/usr/bin:/usr/sbin
10
11# Source function library.
12. /etc/rc.d/init.d/functions
13
14# Source networking configuration.
15. /etc/sysconfig/network
16
17# Check that networking is up.
18if is_yes "${NETWORKING}"; then
19 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
20 msg_network_down winbindd
21 exit 1
22 fi
23else
24 exit 0
25fi
26
27TMPDIR="/tmp"; export TMPDIR
28
29# Check that smb.conf exists.
30[ -f /etc/samba/smb.conf ] || exit 0
31
32RETVAL=0
33# See how we were called.
34case "$1" in
35 start)
36
37 daemon winbindd
38 RETVAL=$?
39 else
40 echo "Winbind is not configured in /etc/samba/smb.conf, not starting"
41 fi
42 echo
43 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/winbind || \
44 RETVAL=1
45 return $RETVAL
46
47 # Check if the service is already running?
48 if [ ! -f /var/lock/subsys/winbind ]; then
49 if [ "`grep -i 'idmap uid' /etc/samba/smb.conf | egrep -v [\#\;]`" -a "`grep -i 'idmap gid' /etc/samba/smb.conf | egrep -v [\#\;]`" ]; then
50 msg_starting winbindd
51 daemon $NICELEVEL winbindd -D
52 RETVAL=$?
53 [ $RETVAL -eq 0] && touch /var/lock/subsys/winbind || \
54 RETVAL=1
55 fi
56 else
57 msg_already_running winbindd
58 fi
59 ;;
60 stop)
61 # Stop daemon.
62 if [ -f /var/lock/subsys/winbind ]; then
63 msg_stopping winbindd
64 killproc winbindd
65 rm -f /var/lock/subsys/winbind >/dev/null 2>&1
66 else
67 msg_not_running winbindd
68 fi
69 ;;
70 status)
71 status winbindd
72 RETVAL=$?
73 [ $RETVAL -eq 0 ] && RETVAL=$RET
74 ;;
75 restart)
76 $0 stop
77 $0 start
78 exit $?
79 ;;
80 reload|force-reload)
81 if [ -f /var/lock/subsys/winbind ]; then
82 msg_reloading winbindd
83 killproc winbindd -HUP
84 RETVAL=$?
85 else
86 msg_not_running winbindd >&2
87 exit 7
88 fi
89 ;;
90 *)
91 msg_usage "$0 {start|stop|restart|reload|force-reload|status}"
92 exit 3
93esac
94
95exit $RETVAL
This page took 0.209664 seconds and 4 git commands to generate.