2022-06-28 08:28:20 +00:00
|
|
|
# This unit is needed to run rngd as a non-privileged user.
|
|
|
|
# It performs a system set up which requires privileges.
|
|
|
|
|
2022-05-17 10:28:09 +00:00
|
|
|
[Unit]
|
|
|
|
Description=Hardware RNG Entropy Gatherer Wake threshold service
|
|
|
|
ConditionVirtualization=!container
|
|
|
|
Before=rngd.service
|
|
|
|
|
|
|
|
[Service]
|
|
|
|
Type=oneshot
|
|
|
|
RemainAfterExit=yes
|
2022-06-28 08:28:20 +00:00
|
|
|
ExecStart=/bin/sh -c "PSIZE=$(cat /proc/sys/kernel/random/poolsize); let THRESH=$PSIZE*3/4; echo $THRESH>/proc/sys/kernel/random/write_wakeup_threshold; if [ -e /dev/hwrng ]; then chmod 0640 /dev/hwrng; chgrp rngd /dev/hwrng; fi"
|
2022-05-17 10:28:09 +00:00
|
|
|
|
|
|
|
[Install]
|
2022-06-28 08:28:20 +00:00
|
|
|
WantedBy=multi-user.target
|