- Timestamp:
- 07/05/10 14:13:56 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/factory/src/factory.py
r379 r380 52 52 self.config = ConfigParser.RawConfigParser() 53 53 self.config.read(os.path.abspath(self.options.config_file)) 54 self.daemon = True 54 55 try: 56 self.daemon = self.config.getboolean('global', 'daemon') 57 except ConfigParser.NoOptionError, e: 58 self.daemon = False 55 59 56 60 # Configure logging … … 72 76 73 77 # Set the pidfile 74 self.pidfile = self.config.get('global', 'pidfile') 78 try: 79 self.pidfile = self.config.get('global', 'pidfile') 80 except ConfigParser.NoOptionError, e: 81 if self.daemon: 82 raise 83 self.pidfile = '/tmp/pydaemon.pid' 75 84 76 85 # Load factory name … … 264 273 265 274 if __name__ == "__main__": 266 parser = OptionParser(usage='Usage: %prog [options] ')275 parser = OptionParser(usage='Usage: %prog [options] start|stop|restart') 267 276 parser.add_option('-c', '--config-file', action='store', type='string', dest='config_file', 268 277 default='../conf/config.ini', help='Full path to the configuration file to read.')
Note: See TracChangeset
for help on using the changeset viewer.