8000 Prevent crash during Cobbler startup on NFS environments by meaksh · Pull Request #3906 · cobbler/cobbler · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Prevent crash during Cobbler startup on NFS environments #3906

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

Merged
merged 3 commits into from
May 14, 2025

Conversation

meaksh
Copy link
Member
@meaksh meaksh commented May 12, 2025

The current flock mechanism used by Cobbler serializer is not working on NFS enviroments, leading to a crash during Cobbler startup.

This PR fixes the flock mechanism to work in NFS environments on Linux kernel >= 2.6.12.

Linked Items

Fixes #3905

Description

As mentioned at https://man7.org/linux/man-pages/man2/flock.2.html:

Since Linux 2.6.12, NFS clients support flock() locks by emulating them as fcntl(2) byte-range locks on the entire file. This means that fcntl(2) and flock() locks do interact with one another over NFS. It also means that in order to place an exclusive lock, the file must be opened for writing.

Behaviour changes

Old: cobbler is not able to start.

New: cobbler starts successfully.

Category

This is related to a:

  • Bugfix
  • Feature
  • Packaging
  • Docs
  • Code Quality
  • Refactoring
  • Miscellaneous

Tests

  • Unit-Tests were created
  • System-Tests were created
  • Code is already covered by Unit-Tests
  • Code is already covered by System-Tests
  • No tests required

@SchoolGuy
Copy link
Member

This will need to wait until #3814 is merged to fix the CI.

@meaksh
Copy link
Member Author
meaksh commented May 12, 2025

I also need to bring some changelog here. I'll add it shortly

@SchoolGuy
Copy link
Member

@meaksh Could you please rebase the PR? I merged the transaction PR with the CI changes.

@SchoolGuy SchoolGuy moved this from Todo to Pull Requests in Cobbler Server May 13, 2025
@SchoolGuy SchoolGuy self-requested a review May 13, 2025 13:50
meaksh added 3 commits May 13, 2025 15:40
Since Linux 2.6.12, NFS clients support flock() locks by emulating
them as fcntl(2) byte-range locks on the entire file.  This means
that fcntl(2) and flock() locks do interact with one another over
NFS.  It also means that in order to place an exclusive lock, the
file must be opened for writing.

https://man7.org/linux/man-pages/man2/flock.2.html
@meaksh meaksh force-pushed the main-prevent-crash-due-nfs-storage branch from 54c0779 to 1c832a3 Compare May 13, 2025 14:44
Copy link
Member
@SchoolGuy SchoolGuy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the bugfix!

@github-project-automation github-project-automation bot moved this from Pull Requests to In Progress in Cobbler Server May 14, 2025
@SchoolGuy SchoolGuy merged commit 90fcfaa into cobbler:main May 14, 2025
29 of 46 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in Cobbler Server May 14, 2025
@meaksh meaksh deleted the main-prevent-crash-due-nfs-storage branch May 14, 2025 10:59
@SchoolGuy SchoolGuy added this to the v3.4.0 milestone May 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Cobbler startup crash when using NFS for storage
2 participants
0