Modify ↓
Ticket #695 (closed enhancement: fixed)
bcfg2-server should log CoreInitExceptions to syslog
Reported by: | Mike McCallister <[email protected]…> | Owned by: | desai |
---|---|---|---|
Priority: | minor | Milestone: | Bcfg2 1.0.0 Release |
Component: | bcfg2-server | Version: | 1.0 |
Keywords: | Cc: |
Description
In upgrading my configuration from 0.9.5.7 to ~1.0 pre5 (r5389), I missed the need to have a Metadata plugin in my bcfg2.conf file. When I started bcfg2-server using the init script, it exits with no indication of an error in syslog or anywhere else I can see. When I run it in debug mode from the console, I see the following traceback:
Traceback (most recent call last): File "/usr/sbin/bcfg2-server", line 64, in ? ca=setup['ca'], File "/usr/lib/python2.4/site-packages/Bcfg2/Component.py", line 60, in run_component component = component_cls(**cls_kwargs) File "/usr/lib/python2.4/site-packages/Bcfg2/Server/Core.py", line 83, in __init__ raise CoreInitError, "No Metadata Plugin" Bcfg2.Server.Core.CoreInitError: No Metadata Plugin
My expectation is that when run in daemon mode, even (or especially) fatal errors should be logged to syslog if at all possible. Something like this might work for CoreInitException:
try: Bcfg2.Component.run_component(Bcfg2.Server.Core.Core, location=setup['location'], daemon = setup['daemon'], pidfile_name = setup['daemon'], protocol = setup['protocol'], register=False, cls_kwargs={'repo':setup['repo'], 'plugins':setup['plugins'], 'password':setup['password'], 'encoding':setup['encoding'], 'ca':setup['ca'], 'filemonitor':setup['fm'], 'start_fam_thread':True}, keyfile=setup['key'], certfile=setup['cert'], ca=setup['ca'], ) except Bcfg2.Server.Core.CoreInitError, msg: logger.error("Core load failed because %s" % msg) except KeyboardInterrupt: sys.exit(1)
If any other exceptions could occur, they should also be caught and reported appropriately.
Attachments
Change History
Note: See
TracTickets for help on using
tickets.