[PATCH 1/3] vars.sh: remove unnecessary fork to speedup boot/upgrades
Trek
trek00 at inbox.ru
Tue Apr 26 22:33:23 BST 2022
On synthetic tests (starting init-d-script with DAEMON=/bin/true),
it is near 7% faster when running with FANCYTTY=0.
---
debian/vars.sh | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/debian/vars.sh b/debian/vars.sh
index f0280fed..f0b106e9 100644
--- a/debian/vars.sh
+++ b/debian/vars.sh
@@ -25,7 +25,12 @@ unset RAMLOCK
# Parse kernel command line
if [ -r /proc/cmdline ]; then
- for ARG in $(cat /proc/cmdline); do
+
+ # Please do not use read on other files under /proc, as it could not work
+ # http://www.chiark.greenend.org.uk/pipermail/debian-init-diversity/2020-August/003548.html
+ read -r cmdline </proc/cmdline
+
+ for ARG in $cmdline; do
case $ARG in
# check for bootoption 'noswap' and do not activate swap
--
2.20.1
More information about the Debian-init-diversity
mailing list