]> git.pld-linux.org Git - packages/samba.git/blame - winbind.init
reversed last change
[packages/samba.git] / winbind.init
CommitLineData
f9c55e20 1#!/bin/sh
2#
3# chkconfig: 345 91 35
bcb88b55 4# description: Starts and stops the Samba winbind daemon to provide\
f9c55e20 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)
f9c55e20 36 # Check if the service is already running?
37 if [ ! -f /var/lock/subsys/winbind ]; then
38 if [ "`grep -i 'idmap uid' /etc/samba/smb.conf | egrep -v [\#\;]`" -a "`grep -i 'idmap gid' /etc/samba/smb.conf | egrep -v [\#\;]`" ]; then
39 msg_starting winbindd
bcb88b55 40 daemon winbindd
f9c55e20 41 RETVAL=$?
42 [ $RETVAL -eq 0] && touch /var/lock/subsys/winbind || \
43 RETVAL=1
edde306a 44 else
45 nls "Winbind is not configured in /etc/samba/smb.conf, not starting"
46 fi
f9c55e20 47 else
48 msg_already_running winbindd
49 fi
50 ;;
51 stop)
52 # Stop daemon.
53 if [ -f /var/lock/subsys/winbind ]; then
54 msg_stopping winbindd
55 killproc winbindd
56 rm -f /var/lock/subsys/winbind >/dev/null 2>&1
57 else
58 msg_not_running winbindd
59 fi
60 ;;
61 status)
62 status winbindd
edde306a 63 RETVAL=$?
f9c55e20 64 ;;
65 restart)
66 $0 stop
67 $0 start
68 exit $?
69 ;;
70 reload|force-reload)
71 if [ -f /var/lock/subsys/winbind ]; then
72 msg_reloading winbindd
73 killproc winbindd -HUP
74 RETVAL=$?
75 else
76 msg_not_running winbindd >&2
77 exit 7
78 fi
79 ;;
80 *)
81 msg_usage "$0 {start|stop|restart|reload|force-reload|status}"
82 exit 3
83esac
84
85exit $RETVAL
This page took 0.072241 seconds and 4 git commands to generate.