From 2901fda29c467ec333f692b50aa0bd4bdce205d4 Mon Sep 17 00:00:00 2001 From: Oneric Date: Tue, 24 Sep 2024 16:47:51 +0200 Subject: [PATCH] openrc: recompile with lower CPU prio --- installation/init.d/akkoma | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/installation/init.d/akkoma b/installation/init.d/akkoma index cd7b70e7e..747abc2c9 100755 --- a/installation/init.d/akkoma +++ b/installation/init.d/akkoma @@ -58,6 +58,12 @@ start_pre() { || eerror "Logfile(s) not owned by $command_user, or not a file!" checkpath --writable "$output_log" "$error_log" \ || eerror "Logfile(s) not writable!" + + # If a recompile is needed perform it with lowest prio + # (delaying the actual start) to avoid hogging too much + # CPU from other services + cd "$directory" + doas -u "${command_user%%:*}" env MIX_ENV="$MIX_ENV" nice -n 19 "$command" compile } healthcheck() {