-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathwinbind.init
More file actions
executable file
·107 lines (94 loc) · 1.83 KB
/
winbind.init
File metadata and controls
executable file
·107 lines (94 loc) · 1.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#!/bin/sh
#
# chkconfig: 345 91 35
# description: Starts and stops the Samba winbind daemon to provide\
# user and group information from a NT domain controller to linux.
#
# config: /etc/samba/smb.conf
# processname: winbindd
export PATH=/bin:/sbin:/usr/bin:/usr/sbin
# Source function library.
. /etc/rc.d/init.d/functions
# Source networking configuration.
. /etc/sysconfig/network
winbindd_pidfile="/var/run/samba/winbindd.pid"
# Daemon specific configuration.
. /etc/sysconfig/winbind
# Check that networking is up.
if is_yes "${NETWORKING}"; then
if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
msg_network_down winbindd
exit 1
fi
else
exit 0
fi
TMPDIR="/tmp"; export TMPDIR
# Check that smb.conf exists.
[ -f /etc/samba/smb.conf ] || exit 0
start() {
if [ ! -f /var/lock/subsys/winbind ]; then
msg_starting winbindd
daemon /usr/sbin/winbindd
RETVAL=$?
if [ $RETVAL -eq 0 ]; then
touch /var/lock/subsys/winbind
RETVAL=1
fi
else
msg_already_running winbindd
fi
}
stop() {
if [ -f /var/lock/subsys/winbind ]; then
msg_stopping winbindd
killproc --pidfile $winbindd_pidfile winbindd
rm -f /var/lock/subsys/winbind >/dev/null 2>&1
else
msg_not_running winbindd
fi
}
condrestart() {
if [ -f /var/lock/subsys/winbind ]; then
stop
start
else
msg_not_running winbindd
RETVAL=$1
fi
}
RETVAL=0
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
reload|force-reload)
if [ -f /var/lock/subsys/winbind ]; then
msg_reloading winbindd
killproc --pidfile $winbindd_pidfile winbindd -HUP
RETVAL=$?
else
msg_not_running winbindd
exit 7
fi
;;
try-restart)
condrestart 0
;;
status)
status winbindd
RETVAL=$?
;;
*)
msg_usage "$0 {start|stop|restart|try-restart|reload|force-reload|status}"
exit 3
esac
exit $RETVAL