I have a Linux device with several services of my own.
Kernel: 4.14.151
systemd: systemd 249 (249.11-0ubuntu3.12)
My services are written as sysvinit services and automatically generated as systemd services using the /run/systemd/generator.early.
Everything worked fine until I wanted to call /usr/bin/ssh-keygen -t ed25519 ... from one of my services.
At that moment, my call to ssh-keygen gets blocked until systemd-random-seed.service is done. But it's not done, it gets to timeout. So the whole boot takes a lot of time.
- I understand
systemd-random-seed.serviceis in charge of starting the entropy pool for randomness, that's whyssh-keygenis blocked. - But, why do they go into dead lock? I would expect
systemd-random-seed.serviceto finish unrelated tossh-keygen. - Before my changes,
systemd-random-seed.servicetook ~16 seconds. (I can see usingsystemd-analyze blameandsystemd-analyze plot > chain.svg. - After my changes it can get to 10 minutes timeout.
- Regardless of my change. Meaning, without adding
ssh-keygencall to one of my services, I've tried to remove one of mysysvinitservice. Doing that makessystemd-random-seed.serviceeven more unpredictable - it finishes after 2-6 minutes. - My purpose was re-writing my
sysvinitservice as asystemdserviceAfter=systemd-random-seed.serviceso it will surely pass.
The bottom line is systemd-random-seed.service is not clear to me.
Can you please explain its behavior? Why doesn't it start regardless of ssh-keygen?
How can I start another service after it finishes?
egdis.