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

Add lock file support #190

Open
jjcarstens opened this issue May 31, 2022 · 0 comments
Open

Add lock file support #190

jjcarstens opened this issue May 31, 2022 · 0 comments

Comments

@jjcarstens
Copy link

Running fwup writes while another fwup process is writing the same drive could be detrimental. Adding a lock file that can be used to infer another fwup process is running could be useful for cases where this needs to strictly be avoided.

Based on offline conversation with Frank, the initial suggestion for implementation is:

  1. Figure out the lock file path. Maybe /tmp/fwup.mmcblk0 or something like that.
  2. Create the lock file if it hasn’t already been created
  3. Register an advisory lock on the file (via lockf). If this fails, then someone else is fwuping
  4. Register an at_exit to erase the file
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

1 participant