Automatically (or semi-automatically) update /boot/grub/grub.conf?
Posted: 2019/06/22 04:34:53
Hi; yep, you read that right: grub (not grub2) on centOS7. Why? Well, I have a remote virtual server with a commercial provider running centOS7. Unfortunately the provider uses pyconf for booting, which is grub (not grub2) compatible; in particular, it uses /boot/grub/grub.conf as the configuration file. It seems to work OK, and I can use yum to update almost everything successfully (including, apparently, the relevant kernel files). However yum does not update the grub.conf file, so it's still booting from the original 2014 kernel even though there are up-to-date kernels installed. Security is reasonably important for me on this machine, so I would really like to be running up-to-date kernels. I could edit the grub.conf file manually, but that is error prone (and boot errors on a remote virtual server are pretty hard to fix). So I'm looking for a way to automate the process as far as possible, to minimise errors.
In order of preference, what I'm looking for are:
1. Good ideas on how to do this (probably someone will have a better suggestion than either of the next two)
2. Any way to get centOS7 to update grub.conf (I suspect this is a forlorn hope, because the centOS7 repos are designed around grub2)
3. Any way to write a reliable script to handle the update - I can't afford to start from scratch, developing bash scripts generally is debug intensive (at least for me), and every error will result in an unbootable server. One thought I had would be to find the script centOS6 uses to update grub.conf, and bongle it, but I haven't had much luck in trying to find where it might be in the centOS6 repos
In order of preference, what I'm looking for are:
1. Good ideas on how to do this (probably someone will have a better suggestion than either of the next two)
2. Any way to get centOS7 to update grub.conf (I suspect this is a forlorn hope, because the centOS7 repos are designed around grub2)
3. Any way to write a reliable script to handle the update - I can't afford to start from scratch, developing bash scripts generally is debug intensive (at least for me), and every error will result in an unbootable server. One thought I had would be to find the script centOS6 uses to update grub.conf, and bongle it, but I haven't had much luck in trying to find where it might be in the centOS6 repos