hypercore-protocol / hyperdrive-daemon

Hyperdrive, batteries included.
MIT License
156 stars 23 forks source link

document unclean shutdown procedure #22

Open edrex opened 4 years ago

edrex commented 4 years ago

I had multiple versions of hyperdrive as I was debugging install, and after hyperdrive fs unmount; hyperdrive stop there were still a bunch of processes runnng. I saw they had pm2 as a common ancestor, which google told me I could:

npm i -g pm2
pm2 kill

Node people probably know the correct procedure but maybe there should be something in the docs about it? Or just make the existing stop subcommand clean up more thoroughly?

edrex commented 4 years ago

@andrewosh maybe I was too far out of supported territory and this won't happen to other users? Your call, feel free to close.

todrobbins commented 4 years ago

I ran into a similar issue while testing the new version of Beaker Browser. The daemon refused to stop even after I quit Beaker:

Screen Shot 2020-03-24 at 12 29 41 PM

I had no mount points, but I tried unmounting anyway:

Screen Shot 2020-03-24 at 12 32 21 PM

Eventually, I was able to kill it with pm2. 🤷‍♂

andrewosh commented 4 years ago

Thanks @edrex. hyperdrive stop should do a full cleanup (it calls pm2.delete internally, which to my understanding should remove all traces of the process). I've noticed that this can bug out unfortunately, so I'll dig in and try to figure out where it's going wrong.

I'd rather make sure hyperdrive stop doesn't leave behind any stragglers rather than document the pm2-based cleanup. Not sure why that's happening, but it's happening to both you and Tod so definitely keeping this open.