def stop (self):

        if self.verbose >= 1:
            print 'Stopping...'

        # Get the pid from the pidfile
        pid = self.get_pid()

        if not pid:

            message = 'pidfile %s does not exist. Not running?\n'
            sys.stderr.write(message % self.pidfile)

            # Just to be sure. A ValueError might occur if the PID file is
            # empty but does actually exist
            if os.path.exists(self.pidfile):
                os.remove(self.pidfile)

            return  # Not an error in a restart

        # Try killing the daemon process
        try:

            i = 0
            while 1:

                os.kill(pid, signal.SIGTERM)
                time.sleep(0.1)
                i += 1
                if i % 10 == 0:
                    os.kill(pid, signal.SIGHUP)

        except OSError, err:

            err = str(err)
            if err.find('No such process') > 0:
                if os.path.exists(self.pidfile):
                    os.remove(self.pidfile)

            else:
                print str(err)
                sys.exit(1)

        if self.verbose >= 1:
            print 'Stopped'
If a first L{Deferred} with a result is returned from a callback on a
dataset/ETHPy150Open leonjza/hogar/hogar/Utils/Daemon.py/Daemon.stop--crossover with--dataset/ETHPy150Open kuri65536/python-for-android/python-modules/twisted/twisted/test/test_defer.py/DeferredTestCase.test_synchronousImplicitChain