From 0c5ee722574815c87d613cb81817e953b2d4644c Mon Sep 17 00:00:00 2001 From: Petr Lautrbach Date: Wed, 27 Jul 2022 11:21:12 +0200 Subject: [PATCH] Run autorelabel in parallel by default https://fedoraproject.org/wiki/Changes/SELinux_Parallel_Autorelabel Resolves: rhbz#2115242 --- selinux-autorelabel | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/selinux-autorelabel b/selinux-autorelabel index f0b5cfa..5290c8c 100755 --- a/selinux-autorelabel +++ b/selinux-autorelabel @@ -51,9 +51,15 @@ relabel_selinux() { echo $"*** Relabeling could take a very long time, depending on file" echo $"*** system size and speed of hard drives." - FORCE=`cat /.autorelabel` - [ -x "/usr/sbin/quotaoff" ] && /usr/sbin/quotaoff -aug - /sbin/fixfiles $FORCE restore + OPTS=`cat /.autorelabel` + # by default, use as many threads as there are available + # another -T X in $OPTS will override the default value + OPTS="-T 0 $OPTS" + + [ -x "/usr/sbin/quotaoff" ] && /usr/sbin/quotaoff -aug + echo + echo $"Running: /sbin/fixfiles $OPTS restore" + /sbin/fixfiles $OPTS restore fi rm -f /.autorelabel