]> git.ipfire.org Git - thirdparty/systemd.git/commit
hostnamed: minimize caching of /etc/hostname, /etc/os-release and /etc/machine-info 15624/head
authorLennart Poettering <lennart@poettering.net>
Tue, 28 Apr 2020 15:42:46 +0000 (17:42 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 25 Jun 2020 11:49:11 +0000 (13:49 +0200)
commitd7f4ad203acb07e728865d5ea117f7df5e8d8166
treecf8c5a4912d80903cf69c894549470d3f7ad73c3
parentaa994368c97bcb4506829d93735999f6bfa4b674
hostnamed: minimize caching of /etc/hostname, /etc/os-release and /etc/machine-info

Instead of reading these files at startup and never again, let's read
them when we need them. As an optimization (in particular as some of
these files contain the data for many fields at once) let's cache the
results as long as the stat data (i.e. mtime) remains stable.

Also, while we are at it, if we can't read any of these props, let's not
fail everything, but continue without the data.
src/hostname/hostnamed.c