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

[BUG] Stopping/deleting jails is broken #373

Closed
zilti opened this issue Apr 14, 2021 · 7 comments
Closed

[BUG] Stopping/deleting jails is broken #373

zilti opened this issue Apr 14, 2021 · 7 comments
Labels
bug Something isn't working

Comments

@zilti
Copy link
Contributor

zilti commented Apr 14, 2021

[MANDATORY] Describe the bug [MANDATORY]
When trying to stop and then delete a jail, it will fail. I have to wait about a minute after stopping a jail before it is possible to delete it.

[MANDATORY] Bastille and FreeBSD version (paste bastille -v && freebsd-version -kru output)

0.8.20210115
12.2-RELEASE
12.2-RELEASE
12.2-RELEASE

[MANDATORY] How did you install bastille? (port/pkg/git)
pkg

[optional] Steps to reproduce?

sudo bastille stop testbox || true
[testbox]:
testbox: removed
sudo bastille destroy testbox || true
Deleting Jail: testbox.
cannot unmount '/usr/local/bastille/jails/testbox/root': Device busy
rm: /usr/local/bastille/jails/testbox/root: Device busy
rm: /usr/local/bastille/jails/testbox: Device busy
Note: jail console logs archived.
/var/log/bastille/testbox_console.log-2021-04-12
sudo bastille create testbox 12.2-RELEASE 10.0.0.5
Valid: (10.0.0.5).
Jail: testbox already created.
@zilti zilti added the bug Something isn't working label Apr 14, 2021
@adriel-tech
Copy link
Contributor

adriel-tech commented Apr 17, 2021

I have also had this issue many times, each time I had to manually umount jailname/root folder.
One time when it happen It deleted files in a zfs mount point when failing to destroying the jail, though this could be unrelated.

I was using:
Bastille 0.8.20210115
host: 12.2-RELEASE
jails: 12.2-RELEASE

I have this happen usually when creating a 'test' jail, destroying it and remaking it a few times in a row using the same name+ip.

@laktech
Copy link

laktech commented Aug 6, 2022

lesson learned, check "issues" and count how many are tagged with "bugs" before adopting. what an embarrassing bug.

@bmac2
Copy link
Collaborator

bmac2 commented Oct 20, 2023

@zilti What would be a valid fix to you for this issue? Possible ones off the top of my head

  1. have destroy wait until jail stops then continue
  2. have destroy through a message that jail has not stopped yet please try again later
  3. ????

Suggest a workable solution to make this go away.

@adriel-tech
Copy link
Contributor

adriel-tech commented Oct 20, 2023

From my experience option 1. Will do the trick. I started to delay my destroy command for a minute after the jail seems to shutdown and I don't get this issue anymore.

But if you want to test it, just add a bunch of mounts to a jail, start it, shutdown and destroy it quickly and you are sure to stumble Into this issue.

@tschettervictor
Copy link
Collaborator

Is this still an issue with the HEAD version?
#749 fixes an issue where if a filesystem is still mounted, it will not attempt to destroy the jail. Doing so would potentially delete files contained inside the mount points.

@bmac2
Copy link
Collaborator

bmac2 commented Dec 17, 2024

@adriel-tech does #749 that @tschettervictor linked above address your issue with mounted filesystems and it deleting them when you destroy???? Is his fix a valid fix for you???

@adriel-tech
Copy link
Contributor

It is fixed for me, I don't have this issue any longer.

@bmac2 bmac2 closed this as completed Dec 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants