Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing the syntax error in the dracut module script #619

Merged
merged 1 commit into from
Jan 18, 2021

Conversation

Rezney
Copy link
Member

@Rezney Rezney commented Nov 12, 2020

edit(pstodulk):
The original dracut module script contained the syntax error so the functionality regarding the /dev/mapper has not been handled as expected. As well, on some systems, this crash lead into immadiate end of the script (by default on rhel 7 this doesn't happen, the script just continue as expected, so not sure what is the difference on some systems regarding the behaviour).

Otherwise we get "[: missing `]" error.

Related PR: #605

Otherwise we get "[: missing `]" error.
@Rezney Rezney requested a review from vinzenz November 12, 2020 12:25
@Rezney
Copy link
Member Author

Rezney commented Nov 12, 2020

Already covered in #583

@Rezney Rezney closed this Nov 12, 2020
@Rezney Rezney reopened this Nov 24, 2020
@Rezney
Copy link
Member Author

Rezney commented Nov 24, 2020

Reopened at @pirat89 request. We aim to merge this sooner rather then later.

@leapp-bot
Copy link
Collaborator

Thank you for contributing to the Leapp project!

Please note that every PR needs to comply with the
Leapp Guidelines and must pass all tests in order to be mergable.

If you want to re-run tests or request review, you can use following commands as a comment:

  • leapp-ci build to run unit tests, copr build and e2e tests in OAMG CI
  • e2e tests to run unit tests, copr build and end-to-end tests in Murphy CI (OAMG members only) [OLD PIPELINE]
  • review please to notify leapp developers of review request

Note: In case there are problems with tests not being triggered automatically on new PR/commit or pending for a long time, please consider rerunning the CI by commenting leapp-ci build (might require several comments). If the problem persists, contact leapp-infra.

@pirat89
Copy link
Member

pirat89 commented Nov 24, 2020

@Rezney after discussion with QE, I am keeping it opened yet for a while.

@vinzenz vinzenz merged commit b204354 into oamg:master Jan 18, 2021
@AloisMahdal
Copy link

Sorry but the description does not provide explanation on how this affects the upgrade.

Otherwise we get "[: missing `]" error.

...is not enough. (If that was the intent then the PR could have just deleted the offending line and not fix it.)

Please don't get confused: the fact that root cause is a syntax error may be obvious, but the the actual effect of fixing the syntax error whole another can of worms and it has not been clarfied.

@pirat89 pirat89 changed the title Add an "AND_IF" after /dev/mapper check Fixing the syntax error in the dracut module script Jan 22, 2021
@AloisMahdal
Copy link

The original dracut module script contained the syntax error so the functionality regarding the /dev/mapper has not
been handled as expected.

What functionality? What, under which circumstances does/does not happen?

As well, on some systems, this crash lead into immadiate end of the script (by default on rhel 7 this doesn't
happen, the script just continue as expected, so not sure what is the difference on some systems regarding
the behaviour).

Can you elaborate on what kind of systems are affected and how?

If we are indeed not sure then I suggest postponing the fix or removing the line until it's clarified.

@vinzenz
Copy link
Member

vinzenz commented Jan 25, 2021

we are not sure why it continues even though there was a bash syntax error. The && has been missing and this is it. It's blocking it needs to be fixed that's why I merged it. This PR has been posted over 2 months ago, I added this line originally and accidentally kept a broken PR out after forgetting to copy over all fixed line from the original fixed system.

The idea is that if /dev/mapper exists the systemd-nspawn parameters are extended to include a bind mount for /dev/mapper otherwise some parts of the system don't get mounted if they are on LVM during the execution.

@AloisMahdal
Copy link

Thanks for explanation.

That said I believe the explanation -- and test coverage -- should have been provided in the original PR.

We went with untested functionality, and the fact that it was untested was discovered only now and only accidentally (only because it was also visibly-ish broken).

</rant>

@AloisMahdal
Copy link

BTW, with regards to the "mystery" I've just looked into POSIX and the thing is that behavior where an argument is passed after ] is not defined, but Bash (rhel7 and fedora33) produces the mentioned error and exit status 2.

The script would exit immediately if -e was applied, so apparently it's not the case. (This is decided by whatever runs the script -- if it's run as executable then shebang is relevant; in our case neither shebang does specify -e.)

@pirat89
Copy link
Member

pirat89 commented Jan 28, 2021

Yep, but on some systems this leads into the same behaviour like the -e is specified. No idea how is that possible. So the fix was neccessary.

drehak added a commit to drehak/leapp-repository that referenced this pull request Feb 2, 2021
## Upgrade handling
### Fixes
- Do not inhibit upgrade with SCA enabled manifest (oamg#615)
- Fix false positive on some comments in /etc/default/grub (oamg#587)
- Fix automated ipa-server removal (oamg#617)
- Fix error at /boot/efi existing on non-EFI systems (oamg#627)
- Fix syntax error in upgrade script (oamg#619)
- Inhibit upgrade if multiple kernel-debug pkgs are installed (oamg#599)
- persistentnetnamesconfig: Fix crash on non-existent interface (oamg#625)

### Enhancements
- Add a possibility to overwrite virtualenv name through environment variables (oamg#613)
- Update product certificates (oamg#624)

Related leapp release: https://github.com/oamg/leapp/releases/tag/v0.12.0
drehak added a commit to drehak/leapp-repository that referenced this pull request Feb 2, 2021
## Upgrade handling
### Fixes
- Do not inhibit upgrade with SCA enabled manifest (oamg#615)
- Fix false positive on some comments in /etc/default/grub (oamg#587)
- Fix automated ipa-server removal (oamg#617)
- Fix error at /boot/efi existing on non-EFI systems (oamg#627)
- Fix syntax error in upgrade script (oamg#619)
- Inhibit upgrade if multiple kernel-debug pkgs are installed (oamg#599)
- persistentnetnamesconfig: Fix crash on non-existent interface (oamg#625)

### Enhancements
- Add a possibility to overwrite virtualenv name through environment variables (oamg#613)
- Update product certificates (oamg#624)

Related leapp release: https://github.com/oamg/leapp/releases/tag/v0.12.0

# Please enter the commit message for your changes. Lines starting
# with '#' will be kept; you may remove them yourself if you want to.
# An empty message aborts the commit.
#
# Date:      Tue Feb 2 15:57:58 2021 +0100
#
# On branch release/202102
# Your branch is up to date with 'drehak/release/202102'.
#
# No changes
@drehak drehak mentioned this pull request Feb 2, 2021
drehak added a commit to drehak/leapp-repository that referenced this pull request Feb 4, 2021
## Packaging
- Bump required leapp-framework capability to 1.4 (oamg#642)

## Upgrade handling
### Fixes
- Fix comparison of the newest installed and booted kernel (oamg#600)
- Fix remediation command for ipa-server removal (oamg#617)
- Fix crash due to missing network interfaces during upgrade phases (oamg#625)
- Fix error with /boot/efi existing on non-EFI systems (oamg#627)
- Fix false positive detection of issue in /etc/default/grub that led into GRUB prompt (oamg#587)
- Fix syntax error in upgrade script (oamg#619)
- Inhibit upgrade with mount options in fstab that break mounting on RHEL 8 (oamg#639)
- Inhibit upgrade on s390x machines with /boot on a separate partition (oamg#641)
- Inhibit upgrade if multiple kernel-debug pkgs are installed (oamg#599)
- Remove the initial-setup package to avoid it asking for EULA acceptance during upgrade (oamg#626)
- Remove the *leapp-resume* service after the *FirstBoot* phase to prevent kill of the leapp process on `systemctl daemon-reload` (oamg#611)

### Enhancements
- Add upgrade support for SAP HANA (own upgrade path) (oamg#503)
- Allow upgrade with SCA enabled manifest (oamg#615)
- Add actors to migrate Quagga to FRR (oamg#467)
- Add stable uniq Key id for every dialog (oamg#618)
- Respect the *kernel-rt* package (oamg#600)

## Additional changes interesting for devels
- Add a possibility to overwrite virtualenv name using `$VENVNAME` (oamg#613)
- Update product certificates for RHEL 8.3 GA and 8.4 Beta/HTB (oamg#624)

Related leapp release: https://github.com/oamg/leapp/releases/tag/v0.12.0
drehak added a commit to drehak/leapp-repository that referenced this pull request Feb 4, 2021
## Packaging
- Bump required leapp-framework capability to 1.4 (oamg#642)

## Upgrade handling
### Fixes
- Fix comparison of the newest installed and booted kernel (oamg#600)
- Fix remediation command for ipa-server removal (oamg#617)
- Fix crash due to missing network interfaces during upgrade phases (oamg#625)
- Fix error with /boot/efi existing on non-EFI systems (oamg#627)
- Fix false positive detection of issue in /etc/default/grub that led into GRUB prompt (oamg#587)
- Fix syntax error in upgrade script (oamg#619)
- Inhibit upgrade with mount options in fstab that break mounting on RHEL 8 (oamg#639)
- Inhibit upgrade on s390x machines with /boot on a separate partition (oamg#641)
- Inhibit upgrade if multiple kernel-debug pkgs are installed (oamg#599)
- Remove the initial-setup package to avoid it asking for EULA acceptance during upgrade (oamg#626)
- Remove the *leapp-resume* service after the *FirstBoot* phase to prevent kill of the leapp process on `systemctl daemon-reload` (oamg#611)

### Enhancements
- Add upgrade support for SAP HANA (own upgrade path) (oamg#503)
- Allow upgrade with SCA enabled manifest (oamg#615)
- Add actors to migrate Quagga to FRR (oamg#467)
- Add stable uniq Key id for every dialog (oamg#618)
- Respect the *kernel-rt* package (oamg#600)

## Additional changes interesting for devels
- Add a possibility to overwrite virtualenv name using `$VENVNAME` (oamg#613)
- Update product certificates for RHEL 8.3 GA and 8.4 Beta/HTB (oamg#624)

Related leapp release: https://github.com/oamg/leapp/releases/tag/v0.12.0
pirat89 pushed a commit that referenced this pull request Feb 4, 2021
## Packaging
- Bump required leapp-framework capability to 1.4 (#642)

## Upgrade handling
### Fixes
- Fix comparison of the newest installed and booted kernel (#600)
- Fix remediation command for ipa-server removal (#617)
- Fix crash due to missing network interfaces during upgrade phases (#625)
- Fix error with /boot/efi existing on non-EFI systems (#627)
- Fix false positive detection of issue in /etc/default/grub that led into GRUB prompt (#587)
- Fix syntax error in upgrade script (#619)
- Inhibit upgrade with mount options in fstab that break mounting on RHEL 8 (#639)
- Inhibit upgrade on s390x machines with /boot on a separate partition (#641)
- Inhibit upgrade if multiple kernel-debug pkgs are installed (#599)
- Remove the initial-setup package to avoid it asking for EULA acceptance during upgrade (#626)
- Remove the *leapp-resume* service after the *FirstBoot* phase to prevent kill of the leapp process on `systemctl daemon-reload` (#611)

### Enhancements
- Add upgrade support for SAP HANA (own upgrade path) (#503)
- Allow upgrade with SCA enabled manifest (#615)
- Add actors to migrate Quagga to FRR (#467)
- Add stable uniq Key id for every dialog (#618)
- Respect the *kernel-rt* package (#600)

## Additional changes interesting for devels
- Add a possibility to overwrite virtualenv name using `$VENVNAME` (#613)
- Update product certificates for RHEL 8.3 GA and 8.4 Beta/HTB (#624)

Related leapp release: https://github.com/oamg/leapp/releases/tag/v0.12.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants