<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def stop(self, signum=None, frame=None):
 """ handel's a termination signal """

        BackgroundProcess.objects.filter(pk=self.process_id
                                         ).update(pid=0, last_update=now(), message='stopping..')
        # run the cleanup
        self.cleanup()
        BackgroundProcess.objects.filter(pk=self.process_id).update(pid=0,
                                                                    last_update=now(),
                                                                    message='stopped')