Don't do this in here, move it into `stopServer` directly.  It doesn't make sense to pair this logic to the value of `users` I dont' think.  In fact, I don't understand why you call all `child.kill` so much below.  Why are you not just doing it once, set a listener for the event, and do things in the callback?  There's some logic problems there.