Daemons bad termination and fix

oHi,

It seems daemons are not always well terminated by default

As I have a lockfile (avoiding multiple instances) stuck after a snap refresh that prevents the snap to relaunch.

Are there any recommendations about that ?

What is default ‘stop-mode’ ? ‘stop-timeout’ ?

Is there a diagram about that ?

To fix it,

Is the ‘post-stop-command’ called between auto-restart (from ‘restart-condition’) so I can remove automatically and securely the lockfile while keeping the single instance protection.

Thx <3