#!/bin/sh trap cleanup 0 1 2 3 6 15 cleanup() { pkill -2 mongod } exec "/usr/bin/mongod" "$@" & wait