def stop(self):
        '''
        Stop the service
        '''
        pid = self.pidfile.validate()
        if not pid:
            message = "pidfile %s does not exist. Service is not running"
            self.logger.error(message % self.pidfile.fname)
            return # not an error in a restart

        # Try killing the service process    
        try:
            while 1:
                os.kill(pid, signal.SIGTERM)
                time.sleep(0.1)
        except __HOLE__, err:
            err = str(err)
            if err.find("No such process") > 0:
                self.pidfile.unlink()
            else:
                self.logger.error('Error during service stop, %s' % str(err))
                raise OSError(err)
        self.logger.info('service [%s] was stopped by SIGTERM signal' % pid)
dataset/ETHPy150Open ownport/pyservice/pyservice.py/Service.stop