Marti
Marti

Reputation: 71

How to fix '(38)Function not implemented: AH00141: Could not initialize random number generator' after upgrading Apache from 2.4.18 to 2.4.46?

I have a running system with Ubuntu 16.04, Apache 2.4.18, PHP 7.3 and 7.4, PHP-FPM, PHP FastCGI, MPM event.

I wanted to upgrade to the latest Apache version (2.4.46-2+ubuntu16.04.1+deb.sury.org+3 amd64 [upgradable from: 2.4.18-2ubuntu3.17]) as follows:

add-apt-repository -y ppa:ondrej/apache2

apt update

apt-get --only-upgrade install apache2

service apache2 restart

Job for apache2.service failed because the control process exited with error code. See "systemctl status apache2.service" and "journalctl -xe" for details.

journalctl -xe

apachectl[9010]: [:crit] [pid 9013] (38)Function not implemented: AH00141: Could not initialize random number generator

I checked and /dev/random and /dev/urandom are installed. Kernel: 4.4.0-042stab141.2 and libc6: 2.23-0ubuntu11.2

Upvotes: 7

Views: 8777

Answers (2)

Lior Gross
Lior Gross

Reputation: 589

Happened to me after upgrading apache to version 2.4.46 on Ubuntu as well. I found out it was the kernel version.

I knew I did apt-get upgrade and the kernel should be latest version, Also running sudo update-grub Showed me newer versions, but running uname -r showed very old (3.x) kernel.

After a long investigation that took almost all day and trying everything I found online about upgrading Ubuntu kernel - I found out it was Digitalocean, not me. Old droplets use externally managed kernel - so no matter what you do on your environment, it will always take the external kernel. The solution was here: https://www.digitalocean.com/docs/droplets/how-to/kernel/grubloader/#switch

If you do see the drop down & change button in your droplet settings in Digital ocean control panel, then your kernel is externally managed. In that drop down type “grub” and choose GrubLoader v0.2, press “change” button & that’s it!

Now you’ll need to shut down & turn back on your server, but before you do so I suggest to run the following commands: sudo apt-get update sudo apt-get upgrade

The above upgrade will update the whole system. To update just kernel run the above update command followed by: sudo apt-get upgrade linux-image-generic

Now shut down (sudo poweroff or power off from DigitalOcean interface, though doing it from CLI is preferred). Note that reboot is not sufficient in this particular case and a complete shut down is needed (Thanks @gauss256 for your comment). Then power it back on from digital ocean interface, And upon startup you should see a new kernel version.

Tip - you might want to delete old Kernel files after the reboot, this can be done by: sudo apt-get purge $( dpkg --list | grep -P -o "linux-image-\d\S+" | grep -v $(uname -r | grep -P -o ".+\d") )

Upvotes: 4

Impresi MLine
Impresi MLine

Reputation: 62

In debian it is only sufficient to execute:

sudo apt-get upgrade linux-image-generic

Then you must check in the output that this produces that it moves the old kernel and configure the new avaible kernel to be used by the system and grub as the main one.

If you see that, you can make a reboot, please double check that. Then after the system restart and after executing the following commands:

uname -r
sudo service apache2 restart
systemctl status apache2.service

You should see that that you are running the new kernel version and that apache did restart succesfully, without the "Could not initialize random number generator" problem.

Hope this helps also the Debian users!

Upvotes: 0

Related Questions