Skip to main content
Topic: What does "random-seed" in dinit-rc exactly do? (Read 461 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

What does "random-seed" in dinit-rc exactly do?

Hello, all members.

I have been recently migrated from Arch to Artix with dinit.
Once I set up the all daemons I need, I found random-seed fails at boot.

Code: [Select]
# dinitctl list
[[+]     ] boot
[{+}     ] system
[{+}     ] login.target (has console)
[{+}     ] local.target
[{+}     ] pre-local.target
[{+}     ] early-fs-local.target
[{+}     ] early-fs-pre.target
[{+}     ] early-devices.target
[{+}     ] udevd-early
[{+}     ] early-prepare.target
[{+}     ] root-ro
[{+}     ] pseudofs
[{+}     ] cgroups
[{+}     ] tmpfs
[{+}     ] kmod-static-nodes
[{+}     ] tmpfiles-dev
[{+}     ] udev-settle
[{+}     ] udev-trigger
[{+}     ] early-root-rw.target
[{+}     ] fsck-root
[{+}     ] early-fs-fstab.target
[{+}     ] fsck
[{+}     ] early-console.target
[{+}     ] early-keyboard.target
[{+}     ] net-lo
[{+}     ] hostname
[{+}     ] swap
[     {X}] random-seed
[{+}     ] early-modules.target
[{+}     ] modules
[{+}     ] sysctl
[{+}     ] binfmt
[{+}     ] hwclock
[{+}     ] locale
[{+}     ] tmpfiles-setup
[{+}     ] sysusers
[{+}     ] cleanup
[{+}     ] network.target
[{+}     ] pre-network.target
[{+}     ] getty
[{+}     ] udevd (pid: 1029)
[{+}     ] iwd (pid: 1285)
[{+}     ] dbus (pid: 1257)
[{+}     ] dbus-pre
[{+}     ] NetworkManager (pid: 1473)
[{+}     ] sddm (pid: 1513)
[{+}     ] logind
[{+}     ] seatd (pid: 1245)
[{+}     ] sddm-pre
[{+}     ] chronyd (pid: 1474)
[{+}     ] turnstiled (pid: 1243)
[{+}     ] acpid (pid: 1242)
[{+}     ] tlp
[{+}     ] apparmor
[{+}     ] firewalld (pid: 1282)
[{+}     ] fcron (pid: 1240)
[{+}     ] bluetoothd (pid: 1281)
[{+}     ] syslog-ng (pid: 1085)
[{+}     ] tty1 (pid: 1531)
[{+}     ] tty2 (pid: 1532)
[{+}     ] tty3 (pid: 1535)
[{+}     ] tty4 (pid: 1533)
[{+}     ] tty5 (pid: 1534)
[{+}     ] tty6 (pid: 1536)

This service runs normally when I execute
Code: [Select]
dinitctl start random-seed
after login.
But my system has any other problems in spite of failure of random-seed.

What does this service do? Can I disable this, or should I fix something to work?

Thanks.


Re: What does "random-seed" in dinit-rc exactly do?

Reply #2
Thanks for explanation, kiblaster.
Adding a logfile line into the random-seed init file resulted in another error, though.

Code: [Select]
[user1@artix-zenbook ~]$ sudo dinitctl status random-seed
Service: random-seed
    State: STOPPED (could not be launched)
        Stage: opening log file
        Error: Success

Without the logfile item, error 1 appears.
Code: [Select]
[user1@artix-zenbook ~]$ sudo dinitctl status random-seed
[sudo] password for user1:
Service: random-seed
    State: STOPPED (failed to start; exited - status 1)

Re: What does "random-seed" in dinit-rc exactly do?

Reply #3
Code: [Select]
Error: Success
anyone else laugh?

Did the log file get made?

Re: What does "random-seed" in dinit-rc exactly do?

Reply #4
You can try to launch the command manually from a terminal.

Re: What does "random-seed" in dinit-rc exactly do?

Reply #5
Code: [Select]
Error: Success
anyone else laugh?

Did the log file get made?

Probably the most weird error this year  :D
No log file was created.

You can try to launch the command manually from a terminal.

It runs normally when I executed on the terminal.
Code: [Select]
[user1@artix-zenbook ~]$ sudo /usr/lib/dinit/seedrng
Seeding 256 bits and crediting
Saving 256 bits of creditable seed for next boot

I'll try to reinstall Artix today.

Re: What does "random-seed" in dinit-rc exactly do?

Reply #6
Unfortunately, reinstall (using weekly built iso) is not the answer.

Next, I modified some rc files:
Code: [Select]
[user1@artix-zenbook ~]$ cat /usr/lib/dinit.d/pre-local.target 
type       = internal
depends-on = early-fs-local.target
depends-on = early-console.target
depends-on = net-lo
depends-on = hostname
waits-for  = swap
# waits-for  = random-seed
waits-for  = sysctl
waits-for  = binfmt
waits-for  = hwclock
waits-for  = locale


Code: [Select]
[user1@artix-zenbook ~]$ cat /usr/lib/dinit.d/random-seed 
type         = scripted
command      = /usr/lib/dinit/seedrng
stop-command = /usr/lib/dinit/seedrng
restart      = false
# waits-for    = early-modules.target
# after        = early-devices.target
# after        = early-root-rw.target
after        = local.target

And finally random-seed gets working.

Re: What does "random-seed" in dinit-rc exactly do?

Reply #7
Hmmmm I remember vaguely about something with hashing and entropy at boot that it helps having a consistent boot when hardware is polling all different random generation numbers, for example: Long time ago when setting up Manjaro-OpenRC from scratch in I think 2016 or 2017, so I've installed it from a barebone base image and gone through all the config all myself - so imagine my consternation when I noticed that my PC started to boot to Linux faster whenever i shook my mouse violently... Back then google was actually working as intended and I quickly found out what all of that matter: https://man.archlinux.org/man/systemd-random-seed.service.8.en

 

Re: What does "random-seed" in dinit-rc exactly do?

Reply #8
Hmmmm I remember vaguely about something with hashing and entropy at boot that it helps having a consistent boot when hardware is polling all different random generation numbers, for example: Long time ago when setting up Manjaro-OpenRC from scratch in I think 2016 or 2017, so I've installed it from a barebone base image and gone through all the config all myself - so imagine my consternation when I noticed that my PC started to boot to Linux faster whenever i shook my mouse violently... Back then google was actually working as intended and I quickly found out what all of that matter: https://man.archlinux.org/man/systemd-random-seed.service.8.en

Humm... interesting. I have never thought what is the kernel entropy pool and why it is important. Thanks for explanation.