`beforeExit` in Meteor


#1

I want to do something before my server shuts down. I tried this:

process.on('beforeExit', function () {
  console.log("look, I'm exiting")
});

This doesn’t appear to work. Any suggestions?


#2

Why would you want that? Can’t do it on startup?