[PATCH] vars.sh: remove unnecessary fork to speedup boot/upgrades

Thorsten Glaser t.glaser at tarent.de
Mon Aug 31 19:30:49 BST 2020


On Mon, 31 Aug 2020, Trek wrote:

> -    for ARG in $(cat /proc/cmdline); do
> +    read -r cmdline </proc/cmdline

Please keep using cat for Linux procfs; reading it from the
shell is broken for many entries (/proc/cmdline isn’t one of
them, but others are:

	https://bugzilla.kernel.org/show_bug.cgi?id=209031

Furthermore, read is slower because it has to read byte for
byte, whereas cat can read in larger blocks. The fork is not
nice but at least one of the shells eligible for /bin/sh has
cat as builtin, so there’s that.

Looking at the script, there’s no way to avoid at least one
fork while sticking to portable /bin/sh due to the mentioned
Linux kernel bug. Sorry.

bye,
//mirabilos
-- 
«MyISAM tables -will- get corrupted eventually. This is a fact of life. »
“mysql is about as much database as ms access” – “MSSQL at least descends
from a database” “it's a rebranded SyBase” “MySQL however was born from a
flatfile and went downhill from there” – “at least jetDB doesn’t claim to
be a database”	(#nosec)    ‣‣‣ Please let MySQL and MariaDB finally die!



More information about the Debian-init-diversity mailing list