]> git.pld-linux.org Git - packages/samba.git/blame - winbind.init
- ldb 1.5.6
[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\
b40190aa 5# user and group information from a NT domain controller to linux.
f9c55e20 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
bd52628c
JB
17# Daemon specific configuration.
18. /etc/sysconfig/winbind
19
f9c55e20 20# Check that networking is up.
21if is_yes "${NETWORKING}"; then
22 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
23 msg_network_down winbindd
24 exit 1
25 fi
26else
27 exit 0
28fi
29
30TMPDIR="/tmp"; export TMPDIR
31
32# Check that smb.conf exists.
33[ -f /etc/samba/smb.conf ] || exit 0
34
81e39ecc 35start() {
f9c55e20 36 if [ ! -f /var/lock/subsys/winbind ]; then
dc1944e1
JR
37 msg_starting winbindd
38 daemon /usr/sbin/winbindd
39 RETVAL=$?
40 if [ $RETVAL -eq 0 ]; then
41 touch /var/lock/subsys/winbind
42 RETVAL=1
edde306a 43 fi
f9c55e20 44 else
45 msg_already_running winbindd
46 fi
81e39ecc
JB
47}
48
49stop() {
f9c55e20 50 if [ -f /var/lock/subsys/winbind ]; then
51 msg_stopping winbindd
52 killproc winbindd
53 rm -f /var/lock/subsys/winbind >/dev/null 2>&1
54 else
55 msg_not_running winbindd
56 fi
81e39ecc
JB
57}
58
59condrestart() {
60 if [ -f /var/lock/subsys/winbind ]; then
61 stop
62 start
63 else
64 msg_not_running winbindd
65 RETVAL=$1
66 fi
67}
68
69RETVAL=0
70# See how we were called.
71case "$1" in
72 start)
73 start
f9c55e20 74 ;;
81e39ecc
JB
75 stop)
76 stop
f9c55e20 77 ;;
78 restart)
81e39ecc
JB
79 stop
80 start
f9c55e20 81 ;;
82 reload|force-reload)
83 if [ -f /var/lock/subsys/winbind ]; then
84 msg_reloading winbindd
85 killproc winbindd -HUP
86 RETVAL=$?
87 else
d8c915ae 88 msg_not_running winbindd
f9c55e20 89 exit 7
90 fi
91 ;;
81e39ecc
JB
92 try-restart)
93 condrestart 0
94 ;;
95 status)
96 status winbindd
97 RETVAL=$?
98 ;;
f9c55e20 99 *)
81e39ecc 100 msg_usage "$0 {start|stop|restart|try-restart|reload|force-reload|status}"
f9c55e20 101 exit 3
102esac
103
104exit $RETVAL
This page took 0.15668 seconds and 4 git commands to generate.