From: thypon <thypon@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] apparmor: load profiles in parallel
Date: Sun, 14 Feb 2021 22:44:05 +0100 [thread overview]
Message-ID: <20210214214405.qgN7X3Fkc69s5PM3gKuZu0tWKZ9pbrBfF_LufSv-rVM@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-28766@inbox.vuxu.org>
[-- Attachment #1: Type: text/plain, Size: 394 bytes --]
There is an updated pull request by thypon against master on the void-packages repository
https://github.com/thypon/void-packages apparmor-parallel
https://github.com/void-linux/void-packages/pull/28766
apparmor: load profiles in parallel
Just a quick mod for parallelizing apparmor profiles on load.
A patch file from https://github.com/void-linux/void-packages/pull/28766.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-apparmor-parallel-28766.patch --]
[-- Type: text/x-diff, Size: 1722 bytes --]
From dc89b6e9c48aac3618e7872fd5e90826a09e542f Mon Sep 17 00:00:00 2001
From: Andrea Brancaleoni <abc@pompel.me>
Date: Sun, 14 Feb 2021 21:39:38 +0000
Subject: [PATCH] apparmor: load profiles in parallel
---
srcpkgs/apparmor/template | 2 +-
srcpkgs/runit-void/files/09-apparmor.sh | 12 +++---------
2 files changed, 4 insertions(+), 10 deletions(-)
diff --git a/srcpkgs/apparmor/template b/srcpkgs/apparmor/template
index 6e7300cff1e..dfbd3ef472f 100644
--- a/srcpkgs/apparmor/template
+++ b/srcpkgs/apparmor/template
@@ -1,7 +1,7 @@
# Template file for 'apparmor'
pkgname=apparmor
version=3.0.1
-revision=2
+revision=3
wrksrc="${pkgname}-v${version}"
build_wrksrc=libraries/libapparmor
build_style=gnu-configure
diff --git a/srcpkgs/runit-void/files/09-apparmor.sh b/srcpkgs/runit-void/files/09-apparmor.sh
index 7d8d09ee80f..f18074dfe90 100644
--- a/srcpkgs/runit-void/files/09-apparmor.sh
+++ b/srcpkgs/runit-void/files/09-apparmor.sh
@@ -18,15 +18,9 @@ if [ -n "$APPARMOR" ]; then
[ "$APPARMOR" = "complain" ] && AACOMPLAIN="-C"
if [ -d /etc/apparmor.d -a -x /usr/bin/apparmor_parser ]; then
- for profile in /etc/apparmor.d/*; do
- case "$profile" in
- *.new-*_*) continue ;;
- esac
- if [ -f "$profile" ]; then
- printf '* Load profile %s: %s\n' "($APPARMOR)" "$profile"
- apparmor_parser -a $AACOMPLAIN "$profile"
- fi
- done
+ find /etc/apparmor.d -maxdepth 1 -type f ! -name '*.new-*_*' |\
+ xargs -d"\n" -I{} --max-procs="$(grep -c ^processor /proc/cpuinfo)" \
+ sh -c "printf '* Load profile %s: %s\n' '($APPARMOR)' '{}'; apparmor_parser -a $AACOMPLAIN '{}'"
else
printf '! AppArmor installation problem - ensure you have installed apparmor package\n'
fi
next prev parent reply other threads:[~2021-02-14 21:44 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-14 21:41 [PR PATCH] " thypon
2021-02-14 21:44 ` thypon [this message]
2021-02-14 21:49 ` [PR REVIEW] " ericonr
2021-02-14 21:51 ` thypon
2021-02-14 21:54 ` [PR PATCH] [Updated] " thypon
2021-02-14 21:58 ` [PR REVIEW] " Gottox
2021-02-14 22:10 ` CameronNemo
2021-02-14 22:28 ` [PR REVIEW] " thypon
2021-02-14 22:29 ` thypon
2021-02-14 22:31 ` Duncaen
2021-02-14 22:38 ` Duncaen
2021-02-14 22:38 ` Duncaen
2021-02-14 23:05 ` [PR PATCH] [Updated] " thypon
2021-02-14 23:06 ` thypon
2021-02-14 23:19 ` [PR PATCH] [Updated] " thypon
2021-02-14 23:21 ` thypon
2021-02-15 22:52 ` [PR PATCH] [Merged]: " thypon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210214214405.qgN7X3Fkc69s5PM3gKuZu0tWKZ9pbrBfF_LufSv-rVM@z \
--to=thypon@users.noreply.github.com \
--cc=ml@inbox.vuxu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).