| Line 24... |
Line 24... |
| 24 |
def __init__(self, logfile='/var/log/services/user.log', pidfile='/tmp/user-server.pid'):
|
24 |
def __init__(self, logfile='/var/log/services/user.log', pidfile='/tmp/user-server.pid'):
|
| 25 |
Daemon.__init__(self, pidfile, stdout=logfile, stderr=logfile)
|
25 |
Daemon.__init__(self, pidfile, stdout=logfile, stderr=logfile)
|
| 26 |
|
26 |
|
| 27 |
def run(self):
|
27 |
def run(self):
|
| 28 |
#get the config client
|
28 |
#get the config client
|
| 29 |
try:
|
- |
|
| 30 |
config_client = ConfigClient()
|
29 |
config_client = ConfigClient()
|
| 31 |
host_name = config_client.get_property('user_service_server_host')
|
30 |
host_name = config_client.get_property('user_service_server_host')
|
| 32 |
port = config_client.get_property('user_service_server_port')
|
31 |
port = config_client.get_property('user_service_server_port')
|
| 33 |
dbname = config_client.get_property('user_service_dbname')
|
32 |
dbname = config_client.get_property('user_service_dbname')
|
| 34 |
db_hostname = config_client.get_property('user_service_db_hostname')
|
33 |
db_hostname = config_client.get_property('user_service_db_hostname')
|
| 35 |
except:
|
- |
|
| 36 |
#error while spawning the config server
|
- |
|
| 37 |
host_name = 'localhost'
|
- |
|
| 38 |
port = 9000
|
- |
|
| 39 |
dbname = 'user'
|
- |
|
| 40 |
db_hostname='localhost'
|
- |
|
| 41 |
|
34 |
|
| 42 |
handler = UserContextServiceHandler(dbname, db_hostname)
|
35 |
handler = UserContextServiceHandler(dbname, db_hostname)
|
| 43 |
processor = UserContextService.Processor(handler)
|
36 |
processor = UserContextService.Processor(handler)
|
| 44 |
transport = TSocket.TServerSocket(port=port)
|
37 |
transport = TSocket.TServerSocket(port=port)
|
| 45 |
tfactory = TTransport.TFramedTransportFactory()
|
38 |
tfactory = TTransport.TFramedTransportFactory()
|