SYSTEMD-RA...D.SERVICE(8)
โจ systemd-random-seed.service โจ
okay bestie, welcome to the systemd-random-seed.service page โ aka the manual for systemd-random-seed, the little guy whose whole job is Load and save the OS system random seed at boot and shutdown. it's giving entropy delivery service, no cap ๐
๐ SYNOPSIS ๐
systemd-random-seed.service
/usr/lib/systemd/systemd-random-seed
๐ธ DESCRIPTION ๐ธ
so like, systemd-random-seed.service is a service that loads an on-disk random seed into the kernel entropy pool during boot and then saves it at shutdown. peek random(4) for the deets.
by default, no entropy is credited when the random seed gets written into the kernel entropy pool, but you can change that with $SYSTEMD_RANDOM_SEED_CREDIT โ more on that below ๐. on disk, the random seed lives in /var/lib/systemd/random-seed.
not me being the bearer of bad news butโฆ this service runs relatively late during the early boot phase. like, generally after the initrd phase has finished and the /var/ file system has been mounted. and so many system services need entropy wayyy earlier than that โ which means this service is of limited use for complex systems ๐ญ
the recommended glow-up? use a boot loader that can pass an initial random seed to the kernel, so entropy is available from earliest boot on. for example systemd-boot(7), with its bootctl random-seed functionality. iconic behavior fr fr ๐ฆ
okay now the part that's actually kind of slay: when loading the random seed from disk, the file is immediately updated with a new seed retrieved from the kernel, so that no two boots ever operate with the same random seed. main character anti-repetition energy โจ
this new seed is retrieved synchronously from the kernel, which means the service will not complete start-up until the random pool is fully initialized. on entropy-starved systems this may take a while ๐. the whole point of this functionality is to be used as a synchronization point for ordering services that require an initialized entropy pool to function securely โ i.e. services that access /dev/urandom without any further precautions.
โ ๏ธ the OS-image replication tea โ ๏ธ
care should be taken when creating OS images that are replicated to multiple systems. if the random seed file is included unmodified, each system will initialize its entropy pool with the same data, and thus โ if otherwise entropy-starved โ generate the same or at least guessable random seed streams ๐
as a safety precaution, crediting entropy is thus disabled by default.
it is recommended to remove the random seed from OS images intended for replication on multiple systems, in which case it is safe to enable entropy crediting (see below ๐). also see Safely Building Images[1].
see Random Seeds[2] for further information.
๐ ENVIRONMENT ๐
$SYSTEMD_RANDOM_SEED_CREDITโ by default,systemd-random-seed.servicedoes not credit any entropy when loading the random seed. with this option that behaviour may be changed: it either takes a boolean parameter or the special string"force". defaults tofalse, in which case no entropy is credited. iftrue, entropy is credited if the random seed file and system state pass various superficial consistency checks. if set to"force", entropy is credited regardless of these checks, as long as the random seed file exists ๐ฅ
added in version 243.
๐ SEE ALSO ๐
systemd(1), random(4), systemd-boot(7), systemd-stub(7), bootctl(1), systemd-boot-random-seed.service(8)
๐ NOTES ๐
- Safely Building Images
https://systemd.io/BUILDING_IMAGES - Random Seeds
https://systemd.io/RANDOM_SEEDS
and that's the whole page bestie, you ate that ๐ซถ this was the systemd-random-seed.service manual, straight out of systemd 262.1 โ go forth and seed responsibly, mwah ๐๐โญ
๐ฆ where this page comes from
- arch rolling: systemd 262.1-1 ยท LGPL-2.1-or-later AND CC0-1.0 AND GPL-2.0-or-later AND MIT-0
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms