0

I have a dedicated server hosted by OVH.

When installing the server I must have left the default choice of kernel which is to use the stable/tested OVH kernel rather than the distribution's native kernel.

I have recently switched to using APF firewall rather than UFW and after setting up APF with all my rules and starting it with apf -s I get an output that looks like this:

apf(11291): {glob} flushing & zeroing chain policies apf(11291):
{glob} firewall offline apf(11328): {glob} activating firewall
libkmod: ERROR ../libkmod/libkmod-module.c:1655
kmod_module_new_from_loaded: could not open /proc/modules: No such
file or directory Error: could not get list of modules: No such file
or directory apf(11368): {glob} kernel version not equal to 2.4.x or
2.6.x, aborting. apf(11328): {glob} firewall initalized

I changed a setting in APF called MONOKERN which is described as "Support Monolithic kernel builds [no LKM's]" after finding a forum post explaining that this is needed due to the kernel some hosts use.

Restarting APF with apf -r then produced this output:

apf(22524): {glob} flushing & zeroing chain policies apf(22524):
{glob} firewall offline apf(22599): {glob} activating firewall
libkmod: ERROR ../libkmod/libkmod-module.c:1655
kmod_module_new_from_loaded: could not open /proc/modules: No such
file or directory Error: could not get list of modules: No such file
or directory apf(22703): {glob} determined (IFACE_UNTRUSTED) eth0 has
address 158.69.123.46 apf(22703): {glob} loading preroute.rules
//carries on printing out the firewall rules it is setting up...
apf(22599): {glob} firewall initalized

OVH have said that I can always change the kernel during a re-installation, but I really don't want to do that.

I host a somewhat popular game on my server with around 100 users online at any given time. To take the server offline for a few hours to reinstall the distribution and set everything up again really isn't practical.

Is it possible to switch back to the native distribution kernel for Ubuntu 16.04 without performing a reinstallation and losing all my configurations/data and installed packages, and if so how?

James
  • 325
  • 2
  • 11
  • How did you install your APF? It looks quite odd that it is expecting 2.4.x or 2.6.x version kernel when Ubuntu 16.0.4 ships with a much newer kernel... – Tero Kilkanen Jan 13 '17 at 06:58
  • I tried using both `apt-get install apf-firewall` and manually installing it from this wget https://github.com/rfxn/advanced-policy-firewall/archive/master.zip – James Jan 13 '17 at 06:59
  • Both methods return the same error messages? – Tero Kilkanen Jan 13 '17 at 07:00
  • @TeroKilkanen yep. Exactly same error. I searched around and the common answer was to change the kernel, which is what ovh suggested too. However they say to just do it via reinstallation and they can't help change it any other way. If APF will run fine without it, I'm happy to leave it as is, but otherwise I'd like to update it without losing everything to a reinstallation. – James Jan 13 '17 at 07:06

1 Answers1

0

You can install a new kernel with apt-get install as usual, and then it should show a menu where you can select the kernel you want to use.

If that does not happen, you can look at the question https://askubuntu.com/questions/52963/how-do-i-set-windows-to-boot-as-the-default-in-the-boot-loader/52990 for further information on editing GRUB settings for booting a particular kernel.

Tero Kilkanen
  • 34,499
  • 3
  • 38
  • 58