Manually install haveged in linux to solve the problem of slow startup

​​​​​

1. Description of the phenomenon 

 Run the sshd service after linux starts, and find that sshd will block for several minutes;

2. Reason

 After checking the system startup log (dmesg can view the startup log), it is found that there are two more lines in the system startup log before and after the sshd blocking ends. The final analysis is because the /dev/random device starts too slowly.
 
 Find information to know that increasing entropy can make random run quickly; (as long as the software that depends on random will start slowly)

3. Install haveged
3.1 Download the installation package

Download address (url): http://www.issihosts.com/haveged/downloads.html

Select the installation package, click the right mouse button, and copy the link

 

Download via wget under linux

3.2 compile haveged

  • decompress

# tar -zxvf haveged-1.9.2.tar.gz

 

  • generate makefile

./configure --host=aarch64-poky-linux --prefix=/workspace/tools/

--host can specify the type of system to be migrated

 

  • make

make && make install

  • Check if the installation is successful

Go to the directory specified during installation to find havedeg

Execute havedeg -h, the following content is displayed, indicating that the installation is successful 

 

4. View the effect

View the current entropy size

cat /proc/sys/kernel/random/entropy_avail

Run the havedeg command

haveged -F -d 32 -w 1024 --verbose=1

Check the entropy size again

 cat /proc/sys/kernel/random/entropy_avail

Guess you like

Origin blog.csdn.net/Apolozie/article/details/127616276