dermotbradley / create-alpine-disk-image

Create cloud-init enabled Alpine disk images for physical machines (PCs & RPIs), VMs, and Cloud servers
GNU General Public License v2.0
93 stars 11 forks source link

Not unmounting in case script breaks execution. #32

Closed HugoFlorentino closed 1 year ago

HugoFlorentino commented 2 years ago

If for any reason script fails without building image, mount points used for chroot remain mounted and calling the script again may fail, creating yet more mount points, and so on.

dermotbradley commented 2 years ago

Have you actually encountered this problem?

The created script registers a TRAP function exactly so that the chroot mountpoints should be removed when an error occurs:

https://github.com/dermotbradley/create-alpine-disk-image/blob/main/lib/disk-image-functions#L2634

HugoFlorentino commented 2 years ago

Have you actually encountered this problem?

I have, multiple times.

The created script registers a TRAP function exactly so that the chroot mountpoints should be removed when an error occurs:

Well apparently it isn't working as expected.

dermotbradley commented 2 years ago

Without some information I don't see how I can investigate.

Is it happening always at the same point or at multiple different places? Is it happening every time or is there some sort of pattern to when it happens? Have you looked at the logfile (with debugging enabled) to see where it is getting to before it fails?

HugoFlorentino commented 2 years ago

Without some information I don't see how I can investigate.

Is it happening always at the same point or at multiple different places? Is it happening every time or is there some sort of pattern to when it happens? Have you looked at the logfile (with debugging enabled) to see where it is getting to before it fails?

I will try doing a few more tests for x86 and x86_64 with and without debugging.

dermotbradley commented 1 year ago

Closing old issue.