aboutsummaryrefslogtreecommitdiffstats
path: root/gentoo/files/cputemp2maxfreq.init
blob: aa2b8461fd0969b1bf44c5ffe7992f0c03772a5b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/sbin/openrc-run
# Copyright 2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

name="cputemp2maxfreq daemon"
description="Daemon to scale scale_max_freq when CPU temperature rises"
command=/usr/sbin/cputemp2maxfreq
command_args="-l $LOGGER -t $TEMPERATURE $OTHER"

start() {
	ebegin "Starting $name"
	start-stop-daemon --start --background \
	--make-pidfile --pidfile /var/run/cputemp2maxfreq.pid \
	--exec ${command} -- ${command_args}
	eend $?
}

start_pre() {
	[ "${RC_CMD}" = "restart" ] && sleep 1
	return 0
}