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

use ephemeral instead of manual/persistent lock during upgrade #1756

Closed
meonkeys opened this issue May 21, 2022 · 2 comments
Closed

use ephemeral instead of manual/persistent lock during upgrade #1756

meonkeys opened this issue May 21, 2022 · 2 comments

Comments

@meonkeys
Copy link
Contributor

meonkeys commented May 21, 2022

docker-entrypoint.sh manually creates a file and uses this to indicate an in-progress upgrade. Manual intervention is required if the upgrade fails halfway and nextcloud-init-sync.lock is never rm'd. How about if we use an automatic flock instead? There's example code in the flock(1) manual page:

(
  flock -n 9 || exit 1
  # ... commands executed under lock ...
) 9>/var/lock/mylockfile

We should be able to just surround all upgrade code like that example, and get rid of touch $lock, if [ -f "$lock" ]; then and rm $lock in docker-entrypoint.sh.

Thoughts?

meonkeys added a commit to meonkeys/nextcloud-docker that referenced this issue May 21, 2022
meonkeys added a commit to meonkeys/nextcloud-docker that referenced this issue May 22, 2022
fix nextcloud#1756

Signed-off-by: Adam Monsen <haircut@gmail.com>
@meonkeys
Copy link
Contributor Author

meonkeys commented Jun 7, 2022

see #1760 for another approach

@meonkeys meonkeys closed this as completed Jun 7, 2022
@meonkeys
Copy link
Contributor Author

meonkeys commented Feb 8, 2023

Note to self: put the lockfile in /var/www/html instead!

meonkeys added a commit to meonkeys/nextcloud-docker that referenced this issue Feb 8, 2023
meonkeys added a commit to meonkeys/nextcloud-docker that referenced this issue Feb 8, 2023
fix nextcloud#1756

Signed-off-by: Adam Monsen <haircut@gmail.com>
meonkeys added a commit to meonkeys/nextcloud-docker that referenced this issue Feb 8, 2023
fix nextcloud#1756

fix nextcloud#1903

Signed-off-by: Adam Monsen <haircut@gmail.com>
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 a pull request may close this issue.

1 participant