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

Docs on lockfile creation are outdated #2702

Open
lmbarros opened this issue May 11, 2023 · 1 comment
Open

Docs on lockfile creation are outdated #2702

lmbarros opened this issue May 11, 2023 · 1 comment

Comments

@lmbarros
Copy link
Contributor

Our Update Locking docs provide some code snippets to show users how to create lockfiles correctly in some languages. I found that at least two of these snippets are outdated.

The shell snippet uses lockfile, which AFAICT was part of procmail, which is unmaintained for a long time. I am not sure what would be the modern replacement. Maybe the utilities in the lockfile-progs package -- though it doesn't seem to be available for Alpine Linux, so I am not sure it is a good choice.

The Python snipped still uses Python 2 syntax, and is based on a library that appears to be deprecated. I am not a Python connoisseur, but I did some tests (using the newer filelock library) and this looks like the modern equivalent:

from filelock import FileLock

lock = FileLock("/tmp/balena/updates.lock")
with lock:
    print(lock.lock_file, 'is locked.')

About this issue tracker

Before creating a issue, check for duplicates. If there is another issue describing
the same bug or problem, please add comments to pre-existing issues or link them to add more context.

While creating a new issue, always make sure to provide as much context as possible with an
expected solution or change that you would like to see in the documentation. This helps
contributors understand the issue and execute a better solution.

If applicable, please add additional links to GitHub projects, forums.balena.io threads,
gist.github.com, Google Drive attachments, screenshots, JF/FD/Front threads for reference, etc.

Thank you for creating an issue and helping us improve balenaCloud's documentation!

@vipulgupta2048
Copy link
Member

@cywang117 @kb2ma @pipex I understand lockfile and its creation are under the domain of the supervisor. Can we make improvements to these examples mentioned in this issue to provide updated information for our users.

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

No branches or pull requests

2 participants