aboutsummaryrefslogtreecommitdiffstats
path: root/main/samba/samba.initd
blob: b7bef10e72be023b28467c075f750873141e4be6 (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
66
67
68
69
#!/sbin/runscript

extra_started_commands="reload"

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

PIDDIR=/var/run/samba

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 ${PIDDIR}/smbd.pid
}

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

stop_nmbd() {
	start-stop-daemon --stop --quiet --pidfile ${PIDDIR}/nmbd.pid
}

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

stop_winbindd() {
	start-stop-daemon --stop --quiet --pidfile ${PIDDIR}/winbindd.pid
}

start() {
	checkpath --directory --owner root:root \
		--mode 755 "$PIDDIR"
	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
}