Refuse to start more processes.

        This runs in response to SIGINT or SIGTERM; if this isn't a
        background process, control-C and a normal ``kill`` command
        cause this.

def stop_gracefully(self):
        '''Refuse to start more processes.

        This runs in response to SIGINT or SIGTERM; if this isn't a
        background process, control-C and a normal ``kill`` command
        cause this.

        '''
        if self.shutting_down:
            self.log(logging.INFO,
                     'second shutdown request, shutting down now')
            self.scram()
        else:
            self.log(logging.INFO, 'shutting down after current jobs finish')
            self.shutting_down = True