When are onStop an onRestart of a Plugin called?

Hi there,
I have almost finished work on my first plugin and I am currently testing the behavior during different system events.
Since my Plugin reserves system resources in onStart and releases them again in onStop, I try to sanity check if it works properly in all situations.
Events tested and the behavior I observe:

  1. volumio vrestart: Seems not to call onStop but calls onStart when restarting
  2. volumio vstop: Seems not to call onStop
  3. volumio vstart: Calls onStart
  4. Deactivate Plugin in the web-interface: calls onStop
  5. Activate Plugin in the web-interface: calls onStart
  6. onRestartseems never to be called (I write a log message there, which never shows up in any log)

This seems to be a bit inconsistent to me, because in my case system resources are not properly released on vrestart and vstop and thus the plugin does not properly start after either was called. I already check if the resources are free, but since I cannot know, if somebody else is using them, I abort my plugins start process if they are not available.
Is this design done on purpose? Any hint, what would be a potential workaround to catch vrestart and vstop and release the resources?

Thanks!
Thomas