Skip to content
This repository was archived by the owner on Dec 20, 2023. It is now read-only.

how to shutdown server #38

Closed
seriousManual opened this issue Apr 29, 2017 · 4 comments
Closed

how to shutdown server #38

seriousManual opened this issue Apr 29, 2017 · 4 comments

Comments

@seriousManual
Copy link

In the documentation you mention that via the mongodb helper the server can be started.
Is there any way to shutdown that server instance programatically?

@smelted-code
Copy link

smelted-code commented Jul 19, 2017

Ideally we'd have a function we could invoke that would terminate the spawned process. But in the meantime, I hope this unblocks folks:

new MongoBins("mongo", ["--eval", "db.getSiblingDB('admin').shutdownServer()"]).run();

Don't forget to pass in your port if it's not the default.

There's probably some slicker mongo-fu out there. Answer provided without warranty, etc. etc.

References:

@winfinit
Copy link
Contributor

this is great, thank you, I will add a helper function.

@StarpTech
Copy link

Any updates? @winfinit should be easy to provide a function to exit the child process. Do you accept PR?

@winfinit
Copy link
Contributor

winfinit commented Aug 10, 2017 via email

deployable added a commit to deployable/mongodb-prebuilt that referenced this issue Feb 1, 2018
Mocha 4+ changed behaviour to "no longer force the process to exit once all tests complete"
so async tasks will keep the test run from completing, the prebuilt-mongod daemon is such a task

This adds helper functions to allow a test to finish

`stop()` will send a `SIGINT` to cleanly shutdown
`kill()` will send a `SIGTERM`

Fixes mongodb-js#38
stropitek referenced this issue in cheminfo/database-aggregator Apr 24, 2018
LoneRifle pushed a commit that referenced this issue Nov 26, 2018
Mocha 4+ changed behaviour to "no longer force the process to exit once all tests complete"
so async tasks will keep the test run from completing, the prebuilt-mongod daemon is such a task

This adds helper functions to allow a test to finish

`stop()` will send a `SIGINT` to cleanly shutdown
`kill()` will send a `SIGTERM`

Fixes #38
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants