summaryrefslogtreecommitdiffstats
path: root/main/samba/samba.initd
blob: f7290173f8e2028bd4d1d5af29ec6db1b6914990 (plain)
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
#!/sbin/runscript

opts="reload"

DAEMON=${SVCNAME#samba.}
if [ "$DAEMON" != "samba" ]; then
	daemon_list=$DAEMON
fi

depend() {
	need net
	after firewall
}

start_smbd() {
	start-stop-daemon --start --quiet --exec /usr/sbin/smbd -- \
		${smbd_options:-"-D"}
}

stop_smbd() {
	start-stop-daemon --stop --quiet --pidfile /var/run/samba/smbd.pid
}

start_nmbd() {
	start-stop-daemon --start --quiet --exec /usr/sbin/nmbd -- \
		${nmbd_options:-"-D"}
}

stop_nmbd() {
	start-stop-daemon --stop --quiet --pidfile /var/run/samba/nmbd.pid
}

start_winbindd() {
	start-stop-daemon --start --quiet --exec /usr/sbin/winbindd -- \
		$winbindd_options
}

stop_winbindd() {
	start-stop-daemon --stop --quiet --pidfile /var/run/samba/winbindd.pid
}

start() {
	for i in $daemon_list; do
		ebegin "Starting $i"
		start_$i
		eend $?
	done
}

stop() {
	for i in $daemon_list; do
		ebegin "Stopping $i"
		stop_$i
		eend $?
	done
}

reload() {
	for i in $daemon_list; do
		ebegin "Reloading $i"
		killall -HUP $i
		eend $?
	done
}