summaryrefslogtreecommitdiff
blob: cef393f283aef51dc12f7683eace7db587b814b2 (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
#!/sbin/runscript
# Copyright 1999-2002 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License, v2 or later
# $Header: /var/cvsroot/gentoo-x86/net-fs/samba/files/samba-init,v 1.2 2003/01/28 04:12:20 woodchip Exp $

opts="${opts} reload"

depend() {
	need net
	use cupsd
}

start() {
	ebegin "Starting samba"
	start-stop-daemon --start --quiet --exec /usr/sbin/smbd
	result=$?
	start-stop-daemon --start --quiet --exec /usr/sbin/nmbd
	result=$(( $result + $? ))
	eend $result
}

stop() {
	ebegin "Stopping samba"
	start-stop-daemon --stop --quiet --pidfile /var/run/samba/smbd.pid
	result=$?
	start-stop-daemon --stop --quiet --pidfile /var/run/samba/nmbd.pid
	result=$(( $result + $? ))
	eend $result
}

reload() {
	ebegin "Reloading samba"
	killall -HUP smbd &>/dev/null
	result=$?
	killall -HUP nmbd &>/dev/null
	result=$(( $result + $? ))
	eend $result
}