'A handler that is called on client startup.'

def OnStartup(self):

    last_request = self.nanny_controller.GetTransactionLog()
    if last_request:
        status = rdf_flows.GrrStatus(status=rdf_flows.GrrStatus.ReturnedStatus.CLIENT_KILLED, error_message='Client    killed    during    transaction')
        nanny_status = self.nanny_controller.GetNannyStatus()
        if nanny_status:
            status.nanny_status = nanny_status
        self.SendReply(status, request_id=last_request.request_id, response_id=1, session_id=last_request.session_id, message_type=rdf_flows.GrrMessage.Type.STATUS)
    self.nanny_controller.CleanTransactionLog()
    action_cls = actions.ActionPlugin.classes.get('SendStartupInfo', actions.ActionPlugin)
    action = action_cls(grr_worker=self)
    action.Run(None, ttl=1)
