aboutsummaryrefslogtreecommitdiffstats
path: root/main/samba36/samba.initd
blob: 4e4f2de71ead095318ef15cdd826b1dd652eefa0 (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
#!/sbin/openrc-run

extra_started_commands="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/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/nmbd.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
}