code: def shutdown(pidfile, signalnb=None, frame=None):
      
      log = logging.getLogger(PROGRAM_NAME)
      log.info("received %s at %s", signalnb, frame)
      log.info("going to remove pidfile %s", pidfile)
      # no point to catch possible errors when we delete the pid file
      os.unlink(pidfile)
      log.info('shutdown is complete')
      sys.exit(0)
docs: Clean up pidfile upon shutdown.
  
      Notice:
          We should register this function as signal handler for the following
          termination signals:
              SIGHUP
              SIGTERM
              SIGABRT
              SIGINT
  
      Arguments:
          pidfile (str): pidfile to remove
          signalnb (int): The ID of signal
          frame (obj): Frame object at the time of receiving the signal