def write_pid(self, pid):
        """ Write pid to the pid file

        :param pid: pid of the process
        :type pid: None | int
        :return: None
        """
        self.fpid.seek(0)
        self.fpid.truncate()
        self.fpid.write("%d" % pid)
        self.fpid.close()
        del self.fpid
Write pid to the pid file

        :param pid: pid of the process
        :type pid: None | int
        :return: None