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

Loop device remains open on error and abort #54

Closed
kmbach opened this issue Feb 14, 2018 · 2 comments
Closed

Loop device remains open on error and abort #54

kmbach opened this issue Feb 14, 2018 · 2 comments

Comments

@kmbach
Copy link

kmbach commented Feb 14, 2018

If pishrink does not leave properly, the loop device remains open. Memory is blocked until the loop device is deleted. A trap handler could solve this Problem.

function cleanup() {
losetup -d "$loopback"
}

trap cleanup SIGINT SIGTERM EXIT

Please check and implement if necessary.

@framps
Copy link
Contributor

framps commented Feb 14, 2018

@kmbach I like your proposal and modified pishrink in my fork. Please test whether it's working as expected. If yes, let me know and I will create a PR.

@kmbach
Copy link
Author

kmbach commented Feb 15, 2018

Hi, framp, I provokad a 'ERROR: Image already shrunk to smalllest size'
And as expected - the loop drive was deleted.

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