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