skill-aircrack icon indicating copy to clipboard operation
skill-aircrack copied to clipboard

Not cleaning up properly on exit.

Open JonStratton opened this issue 7 years ago • 4 comments

Leaving the interface stuck on monitor mode when exiting. Leaving the temp file out there. There should be some way to cleanup on exit.

JonStratton avatar Jul 14 '18 14:07 JonStratton

override the shutdown method! https://github.com/MycroftAI/mycroft-core/blob/dev/mycroft/skills/core.py#L1296

JarbasAl avatar Jan 18 '19 23:01 JarbasAl

Hey @JarbasAl , I tried using the shutdown method and it doesn't seem to handle the particular cases I am playing around with. The two cases are:

  1. Changing a skill while mycroft is running. This appears to cause the skill to be reloaded. Shutdown doesn't seem to be called in this case.
  2. Control-Cing out of running mycroft in debug mode.

There is a chance I am misunderstanding the use of shutdown(), but when I grep around other skills using it, it seems to be the same way I am attempting to use it.

I am, for now, settling on using the del() for cleanup. However, this only seems to be helpful for the first case.

JonStratton avatar Jan 19 '19 00:01 JonStratton

you can disable skill reloading https://github.com/MycroftAI/mycroft-core/blob/dev/mycroft/skills/core.py#L377 , but i think skill reloading will also call the shutdown method, i might be wrong though

ctrl+c should call shutdown for every skill, however if you are anything like me and kill the process / ctrl+c twice there is no clean way around that...

JarbasAl avatar Jan 19 '19 01:01 JarbasAl

Hey @JarbasAl , You appear to be correct. I made sure I single ctrl+c'ed it, and it behaved as it should have. I have switched the code over for now to make it behave a little more standard.

However, there appears to still be an issue with removing the pcap file (which would be owned by root). I will keep this open until I figure out what to do here. I want to avoid additional sudo commands if possible.

JonStratton avatar Jan 23 '19 01:01 JonStratton