summaryrefslogtreecommitdiff
blob: a8b700a39b4c2e34d0fbe3c90a34e533c090500e (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
#!/sbin/runscript
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-process/daemontools/files/svscan-0.76-r4,v 1.2 2005/04/27 23:41:30 vapier Exp $

depend() {
	need net
	after net
	before ntpd ntp-client
	before spamd
	before apache apache2
}

start() {
	ebegin "Starting service scan"
	(
	# workaround for #25754
	unset -f `declare -F | sed 's:declare -f::g'`
	PATH="/usr/bin:$PATH"
	start-stop-daemon --start --quiet --exec /usr/bin/svscan --pidfile /var/run/svscan.pid -- /service &
	echo $! > /var/run/svscan.pid
	)
	eend $?
}

stop() {
	ebegin "Stopping service scan"
	start-stop-daemon --stop --quiet --pidfile /var/run/svscan.pid
	eend $?
	ebegin "Stopping services"
	svc -dx /service/* 2>/dev/null
	eend $?
	ebegin "Stopping service logging"
	svc -dx /service/*/log 2>/dev/null
	eend $?
}