Bug 1311842 - "waagent -serialconsole" break the menu.lst soft link in rhel6.7, and the kernel line match string is not accurate
"waagent -serialconsole" break the menu.lst soft link in rhel6.7, and the ker...
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: WALinuxAgent (Show other bugs)
Unspecified Linux
medium Severity medium
: rc
: ---
Assigned To: Yue Zhang
Virtualization Bugs
Depends On:
Blocks: 1366045 1359574 1387784
  Show dependency treegraph
Reported: 2016-02-25 02:43 EST by yuxisun@redhat.com
Modified: 2016-11-16 01:20 EST (History)
10 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2016-08-09 04:46:40 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
/boot/grub/menu.lst picture. (11.93 KB, image/png)
2016-02-25 02:43 EST, yuxisun@redhat.com
no flags Details

  None (edit)
Description yuxisun@redhat.com 2016-02-25 02:43:36 EST
Created attachment 1130431 [details]
/boot/grub/menu.lst picture.

Description of problem:
1. In RHEL6.7 OS, menu.lst is a soft link point to the grub.conf. The "waagent --serialconsole" deletes the menu.lst and writes a new one, which breaks the soft link, so that the menu.lst cannot be used while booting.
2. All the lines include "kernel" string are added "console=ttyS0 earlyprintk=ttyS0", including real kernel lines and some introduction lines.

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

How reproducible:

Steps to Reproduce:
1. waagent -serialconsole
2. Check the /boot/grub/menu.lst files that if the string "console=ttyS0 earlyprintk=ttyS0" is added to menu.lst file kernel line. Other lines are not changed.
    Use "ls -l" to check the menu.lst file that if it is a soft link point to the grub.conf file.
3. Reboot OS, enter the grub and input "a", check the kernel parameters.

Actual results:
The string "console=ttyS0 earlyprintk=ttyS0" is added to menu.lst but not in grub.conf file. And the soft link of menu.lst has been broken.

Expected results:
1. The menu.lst is a soft link point to the grub.conf. The "console=ttyS0 earlyprintk=ttyS0" is added to the menu.lst file.
2. Only kernel lines are added "console=ttyS0 earlyprintk=ttyS0" string. Other lines (such as introduction lines) are not changed.

Additional info:
grubKernelBootOptionsFile = '/boot/grub/menu.lst'
def ReplaceFileContentsAtomic(filepath, contents):
    os.write(handle, contents)
self.grubKernelBootOptionsLine = 'kernel'
def AppendToLinuxKernelCmdline(option):
    if not FindInLinuxKernelCmdline(option):
        rep=r'\1\2 '+ option + r'\3'
Comment 3 yuxisun@redhat.com 2016-08-09 04:46:40 EDT
This feature doesn't exist in WALinuxAgent-2.1.5. Close it.

*** This bug has been marked as a duplicate of bug 1360493 ***

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