added a trap for sigterm to trigger a threaddump