toxyl / ossh

... is a dirty mix of honey and tar, delivered by a fake SSH server.
Other
2 stars 1 forks source link

Device or resource busy #16

Closed toxyl closed 2 years ago

toxyl commented 2 years ago

After connecting I ran cd (without args) which caused oSSH to crash. Seems like that left the overlayFS in an undefined state:

rm: cannot remove 'ffs/sandboxes/127.0.0.1/merge-1651444220': Device or resource busy
toxyl commented 2 years ago

cd is fixed in #18

toxyl commented 2 years ago

Maybe we should have a cleanup mechanism to ensure everything is properly unmounted if oSSH crashes.

dylandreimerink commented 2 years ago

There are really 3 issues:

  1. No panic catch, if we panic in a connection the whole ossh goes down.
  2. No graceful shutdown, if you shutdown ossh with pending sessions the defered unmount isn't triggered
  3. The FS seems to be busy some time after we are done, perhaps some copying in the background or files which are not closed properly which can give the 'Device or resource busy' for me it seems to be 50/50. So instead of trying once, we should start a goroutine to retry unmounting a few times. Also on startup we should check if there are any merge-.. or work-... directories which we can unmount / remove
toxyl commented 2 years ago
  1. yup, certainly needed.
  2. again yup, this also becomes important for config edits via the webinterface (soon™)
  3. for me it was solved once I used sudo umount on the directory, but I didn't test often. the goroutine for checking as well as the startup check sound good to me :+1: