fixing up the extension to better read the actual state of the daemon instead of relying exclusively on the pid file