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

when do bash scripts/clean.sh, db/data/*/** cannot be purged #94

Closed
delphieritas opened this issue Jul 7, 2020 · 4 comments
Closed

Comments

@delphieritas
Copy link
Contributor

[USERNAME@panda14 singa-auto]$ bash scripts/clean.sh
---import common utility functions---
Confirm remove /hdd1/USERNAME/singa-auto/db/data/? (y/n) y
Removing /hdd1/USERNAME/singa-auto/db/data/
...
rm: cannot remove '/hdd1/USERNAME/singa-auto/db/data/base/13014': Permission denied
rm: cannot remove '/hdd1/USERNAME/singa-auto/db/data/base/1': Permission denied
rm: cannot remove '/hdd1/USERNAME/singa-auto/db/data/base/13015': Permission denied
rm: cannot remove '/hdd1/USERNAME/singa-auto/db/data/pg_multixact/members': Permission denied
rm: cannot remove '/hdd1/USERNAME/singa-auto/db/data/pg_multixact/offsets': Permission denied

delphieritas added a commit to delphieritas/singa-auto that referenced this issue Jul 16, 2020
This is to solve issue nusdbsystem#94 

by changing
bash ./scripts/save_db.sh
to
bash ./scripts/docker_swarm/save_db.sh
@delphieritas
Copy link
Contributor Author

Hi, this issue was investigated and solution proposed here
dev...delphieritas:patch-1

@delphieritas
Copy link
Contributor Author

@naili-xing Pls help to merge this proposed #97

NLGithubWP added a commit that referenced this issue Jul 16, 2020
Update stop_db.sh. This is to solve issue #94
delphieritas added a commit to delphieritas/singa-auto that referenced this issue Jul 30, 2020
This is to solve issue nusdbsystem#94 

by changing
bash ./scripts/save_db.sh
to
bash ./scripts/docker_swarm/save_db.sh
@delphieritas
Copy link
Contributor Author

delphieritas commented Aug 1, 2020

This issue is native for docker. Since when container binds volume to a directory of certain uid:gid (numeric), the binded volume would have the same . Refer to moby/moby#3124

And might be solved by manually bash into container as root, and following steps here https://stackoverflow.com/questions/42423999/cant--file-created-via-docker

  1. docker exec -it --privileged -- root container_id /bin/bash
  2. cd directory && rm -r * .*

but this method would cause container crash

@delphieritas
Copy link
Contributor Author

delphieritas commented Aug 20, 2020

docker image need to be built with sub user added. https://vsupalov.com/docker-shared-permissions/

this issue happened since we did not add users into images.

when we bash start.sh, and do start_db, there is a line docker run .... $VOLUME_MOUNTS, copies these sudo files into container

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