aboutsummaryrefslogtreecommitdiffstats
path: root/unmaintained/libcgroup/cgred.initd
blob: e5d027f2d3258632bebd89c18683c39438d03e09 (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
#!/sbin/openrc-run
#
# CGroups Rules Engine Daemon
#
# This is a daemon for automatically classifying processes into cgroups based
# on UID/GID.
#
extra_started_commands="reload"

name="CGroup Rules Engine Daemon"
command="/usr/sbin/cgrulesengd"
pidfile=${PID_FILE:-"/var/run/cgred.pid"}
command_args="${NODAEMON} ${LOG}"
start_stop_daemon_args="--make-pidfile --background --stdout /dev/null"


depend() {
	need cgconfig
	use logger
}

start_pre() {
	if [ -n "${LOG_FILE}" ]; then
		command_args="${command_args} --log-file=${LOG_FILE}"
	fi
}

reload() {
	ebegin "Reloading ${name}"
	start-stop-daemon --signal USR2 --pidfile "${pidfile}" \
		--exec "${command}"
	eend $?
}