summaryrefslogtreecommitdiff
blob: a921c0d574d327797fd227eee7e164ba9c73cd0d (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
#!/sbin/runscript
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$

extra_started_commands="buffer unbuffer"

PIDFILE=/var/run/metalog.pid

depend() {
	need localmount
	use clock hostname
	after bootmisc
	provide logger
}

ssd() { start-stop-daemon --exec /usr/sbin/metalog --pidfile "${PIDFILE}" "$@" ; }

start() {
	ebegin "Starting metalog"
	ssd --start -- \
	    --daemonize --pidfile="${PIDFILE}" ${METALOG_OPTS}
	eend $?
}

stop() {
	ebegin "Stopping metalog"
	ssd --stop
	eend $?
}

buffer() {
	ebegin "Enabling log buffering"
	ssd --signal USR2
	eend $?
}

unbuffer() {
	ebegin "Disabling log buffering"
	ssd --signal USR1
	eend $?
}