To determine if the Operating System exhibits this behaviour at the time:
Try to display a portion of these files from a shell prompt and note the time difference:
$ head -n 10 /dev/random
$ head -c 10 file:/dev/urandom
or, due to a defect in certain distributions:
$ head -c 10 ///dev/urandom [ or ] head -c 10 /dev/./urandom
An OpenEdge 12.2 catalina.log demonstrates the delay in the: o.a.c.v.StuckThreadDetectionValve.notifyStuckThreadDetected & eventually o.a.c.v.StuckThreadDetectionValve.notifyStuckThreadCompleted messages.
To use /dev/urandom generator instead
This does not make cryptography less secure. The following Blog summarises why:
Configure the JVM to use /dev/urandom:
The java.security file, used for security management is found in the following locations:
$ sudo find / -iname java.security
- Java 8, and earlier versions: $JAVA_HOME/jre/lib/security/java.security. For OpenEdge 11 which ships with java, this would be: $DLC/jre/lib/security/java.security
- Java 11: $JAVA_HOME/conf/security/java.security
Open the
java.security file in a text editor, as root user:
Change the following line:
securerandom.source=file:/dev/random
to read:
securerandom.source=file:/dev/urandom
After Saving the update, restart the AdminServer.
Another method is to use the RNGD ServiceThe rngd service is part of the rng-tools package on both Debian and Red Hat / CentOS based systems.
As a quick verification, run the following command as root, then start the AdminServer which will no longer experience the delay on startup:
This command can be added to /etc/rc.local or crontab to be run at system startup.
$ rngd -r /dev/urandom
$ proadsv -start
The following information is provided as a guideline, refer to OS documentation for details specific to your Linux distribution.
Install “rng-tools” if not exists. Login with root privileges and run:
UBUNTU: apt-get install rng-tools
Update "/etc/default/rng-tools" file to add “HRNGDEVICE=/dev/urandom”
Start rng-tools:
/etc/init.d/rng-tools start
CentOS: yum install rng-tools
Edit the service unit file: /usr/lib/systemd/system/rngd.service
[Service]
ExecStart=/sbin/rngd -f -r /dev/urandom
Reload the unit file, start the service and check it's status:
$ systemctl enable rngd
$ systemctl daemon-reload
$ systemctl start rngd
$ systemctl status rngd
.