def start(self, *args, **kw):
        """
        Start the daemon
        """
        # Check for a pidfile to see if the daemon already runs
        try:
            pidfile = file(self.pidfile, 'r')
            pid = int(pidfile.read().strip())
            pidfile.close()
        except IOError:
            pid = None

        if pid:
            message = "pidfile %s already exist. Daemon already running?\n"
            sys.stderr.write(message % self.pidfile)
            sys.exit(1)

        # Start the daemon
        self.daemonize()
        self.run(*args, **kw)
def start ( self , * args , ** kw ) : try : pidfile = file ( self . pidfile , 'r' ) pid = int ( pidfile . read ( ) . strip ( ) ) pidfile . close ( ) except IOError : pid = None if pid : message = "pidfile %s already exist. Daemon already running?\n" sys . stderr . write ( message % self . pidfile ) sys . exit ( 1 ) self . daemonize ( ) self . run ( * args , ** kw )
Start the daemon