Rev 749 | Rev 751 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed
| Rev 749 | Rev 750 | ||
|---|---|---|---|
| Line 296... | Line 296... | ||
| 296 | """load config defaults, or last config if exists""" |
296 | """load config defaults, or last config if exists""" |
| 297 | """run startup.cfg""" |
297 | """run startup.cfg""" |
| 298 | print 'INIT: Loading daemon configuration' |
298 | print 'INIT: Loading daemon configuration' |
| 299 | self.cfg = DaemonConfig() |
299 | self.cfg = DaemonConfig() |
| 300 | self.cfg.load() |
300 | self.cfg.load() |
| - | 301 | ||
| - | 302 | # create interface for debugging purpose |
|
| - | 303 | self.cfg.addInterface('tcp', None) |
|
| 301 | 304 | ||
| 302 | self.ifNotifier = self.IfNotifier(self) |
305 | self.ifNotifier = self.IfNotifier(self) |
| 303 | for nodeIf in self.cfg.nodeInterfaces: |
306 | for nodeIf in self.cfg.nodeInterfaces: |
| 304 | nodeIf.setIfNotifier(self.ifNotifier) |
307 | nodeIf.setIfNotifier(self.ifNotifier) |
| 305 | 308 | ||
| Line 325... | Line 328... | ||
| 325 | 328 | ||
| 326 | print 'Shutdown' |
329 | print 'Shutdown' |
| 327 | self.cfg.save() |
330 | self.cfg.save() |
| 328 | 331 | ||
| 329 | for nodeIf in self.cfg.nodeInterfaces: |
332 | for nodeIf in self.cfg.nodeInterfaces: |
| 330 | if |
333 | if nodeIf.running(): |
| 331 | print 'Stopping If thread' |
334 | print 'Stopping If thread' |
| 332 |
|
335 | nodeIf.stop() |
| 333 | 336 | ||
| 334 | print 'Waiting 0.1..' |
337 | print 'Waiting 0.1..' |
| 335 | time.sleep(0.1) # wait for threads |
338 | time.sleep(0.1) # wait for threads |
| 336 | print 'Terminating' |
339 | print 'Terminating' |
| 337 | sys.exit(0) # will except if there are threads remaining |
340 | sys.exit(0) # will except if there are threads remaining |