summaryrefslogtreecommitdiff
path: root/user/metalog/metalog.initd-r1
blob: bb947bdadf8d8e100c35c2b7b9d81acbf7f05837 (plain) (blame)
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
#!/sbin/openrc-run
# Copyright 1999-2018 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

pidfile="${PIDFILE:-/run/metalog.pid}"
command="/usr/sbin/metalog"
command_args="--pidfile=${pidfile} --daemonize ${METALOG_OPTS}"

extra_started_commands="buffer unbuffer"

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

buffer() {
	ebegin "Enabling log buffering"
	start-stop-daemon --exec "${command}" --signal USR2 --pidfile "${pidfile}"
	eend ${?}
}

unbuffer() {
	ebegin "Disabling log buffering"
	start-stop-daemon --exec "${command}" --signal USR1 --pidfile "${pidfile}"
	eend ${?}
}