Added shutdown time limit

added a shutdown time to stop listener while running.
part of [78753122](https://www.pivotaltracker.com/story/show/78753122)