def start(self):
        ''' Start the service
        '''        
        # Check for a pidfile to see if the service already runs
        current_pid = self.pidfile.validate()
        if current_pid:
            message = "pidfile %s exists. Service is running already"
            self.logger.error(message % current_pid)
            print >> sys.stderr, message % current_pid
            return

        # Start the service
        if self.daemonize():
            # create pid file
            try:
                self.pidfile.link()
            except __HOLE__, err:
                self.logger.error('Error during service start, %s' % str(err))
                print >> sys.stderr, 'Error during service start, %s' % str(err)
                return
            # activate handler for stop the process
            atexit.register(self.remove_pid)

            try:            
                self.logger.info('process [%s] starting' % self.process.__name__)
                user_process = self.process()
                user_process.logger = self.logger
                if getattr(user_process, 'do_start'):
                    user_process.do_start()
                if getattr(user_process, 'run'):
                    user_process.run()
                else:
                    msg = 'Method run() is not defined for the process: %s' % self.process 
                    self.logger.error(msg)
                    raise RuntimeError(msg)
            except Exception, err:
                self.logger.error(err)
                print err
                return
dataset/ETHPy150Open ownport/pyservice/pyservice.py/Service.start