Bug 723717 - grubby --remove-kernel=2 should work per man page, but it seems to loop instead
grubby --remove-kernel=2 should work per man page, but it seems to loop instead
Product: Fedora
Classification: Fedora
Component: grubby (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Peter Jones
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2011-07-20 17:12 EDT by Seth D. Alford
Modified: 2012-08-16 11:05 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2012-08-16 11:05:00 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Seth D. Alford 2011-07-20 17:12:19 EDT
Description of problem:

The grubby(1) man page says, in part:

       There  are  a  number  of  ways  to specify the kernel used for --info,
       --remove-kernel,  and  --update-kernel.  Specificying  DEFAULT  or  ALL
       selects  the  default entry and all of the entries, respectively.  If a
       comma separated list of numbers is given, the boot entries  indexed  by
       those  numbers  are selected. Finally, the title of a boot entry may be
       specified by using TITLE=title as the argument; all entries  with  that
       title are used.

grubby --info=2, for example tells me information about the second entry
in /boot/grub/grub.conf.  But, grubby --remove-kernel=2 results in a grubby
process which does not exit and which uses up lots of cpu time.

Version-Release number of selected component (if applicable):

grubby version 7.0.16

How reproducible: every time

Steps to Reproduce:
1.  Since you probably do not want to clobber your grub.conf file,
    make a copy of it to your home directory.  Here's what I did:

    cp /boot/grub/grub.conf /home/setha/grub.conf

2.  I have seen the problem when running grubby as root, or as my
    normal user setha.  But, become root anyway.  That way you won't
    dismiss this bug because you think it is just a permissions problem.

3.  Here's my grub.conf file from my Fedora 14 installation.  Use this
    or use your own.  I don't think it is specific to this particular
    grub.conf file.  I've also seen the same problem on CentOS with a
    much different grub.conf file.

# grub.conf generated by anaconda
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,0)
#          kernel /vmlinuz-version ro root=/dev/sda3
#          initrd /initrd-version.img
# boot=/dev/sda
# Commented out 3PM 8/12 in an effor to fix the ctl-alt-f2 ctl-alt-f7
# blank screen problem
# splashimage=(hd0,0)/grub/splash.xpm.gz
# hiddenmenu
title Fedora (
	root (hd0,0)
	kernel /vmlinuz- ro root=LABEL=/ rhgb quiet SYSFONT=latarcyrheb-sun16 LANG=en_US.UTF-8 KEYTABLE=us
	initrd /initramfs-
title Fedora (
	root (hd0,0)
	kernel /vmlinuz- ro root=LABEL=/ rhgb quiet SYSFONT=latarcyrheb-sun16 LANG=en_US.UTF-8 KEYTABLE=us
	initrd /initramfs-
title Fedora (
	root (hd0,0)
	kernel /vmlinuz- ro root=LABEL=/ rhgb quiet SYSFONT=latarcyrheb-sun16 LANG=en_US.UTF-8 KEYTABLE=us
	initrd /initramfs-

4.  Try to delete the entry with index 2 from the file.  Since index numbers
start at 0, this should remove the 3rd entry.  Again, I suggest doing this
as root:

    # do this just to show reference by index works:
    grubby --config-file /home/setha/grub.conf --info=2

    # this command does not return
    grubby --config-file /home/setha/grub.conf --remove-kernel=2

Actual results:

The --info command returns almost immediately with information about
the entry with index 2 (ie, the 3rd entry) in the grub.conf file:

args="ro rhgb quiet SYSFONT=latarcyrheb-sun16 LANG=en_US.UTF-8 KEYTABLE=us"

The --remove-kernel command runs and runs and runs, eating up cpu time and not actually doing anything.

Expected results:

grubby --remove-kernel=2 would work just like grubby --info=2 works and
just like the man page says it should work.  It will operate on the entry
with index 2 and remove it from the grub.conf file.

Additional info:
Comment 1 Fedora End Of Life 2012-08-16 11:05:03 EDT
This message is a notice that Fedora 14 is now at end of life. Fedora 
has stopped maintaining and issuing updates for Fedora 14. It is 
Fedora's policy to close all bug reports from releases that are no 
longer maintained.  At this time, all open bugs with a Fedora 'version'
of '14' have been closed as WONTFIX.

(Please note: Our normal process is to give advanced warning of this 
occurring, but we forgot to do that. A thousand apologies.)

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, feel free to reopen 
this bug and simply change the 'version' to a later Fedora version.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we were unable to fix it before Fedora 14 reached end of life. If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora, you are encouraged to click on 
"Clone This Bug" (top right of this page) and open it against that 
version of Fedora.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 

Note You need to log in before you can comment on or make changes to this bug.