Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 293450 Details for
Bug 430011
ipa-webgui init script should verify that ipa-webgui started successfully
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Add debug, foreground flags. Enable logging in script to catch startup errs
freeipa-615-startup.patch (text/plain), 2.99 KB, created by
Rob Crittenden
on 2008-01-30 16:57:00 UTC
(
hide
)
Description:
Add debug, foreground flags. Enable logging in script to catch startup errs
Filename:
MIME Type:
Creator:
Rob Crittenden
Created:
2008-01-30 16:57:00 UTC
Size:
2.99 KB
patch
obsolete
># HG changeset patch ># User Rob Crittenden <rcritten@redhat.com> ># Date 1201712133 18000 ># Node ID 18ed39a75e8460e26a41e5633e21cd6af05fef94 ># Parent 314f63420b86aabf793dbc264dccef5751dd8c7c >Enable logging so we can catch startup errors either in the console or >the error log. >Add a foreground and debug flag >Resolves 430011 > >diff -r 314f63420b86 -r 18ed39a75e84 ipa-server/ipa-gui/ipa_webgui >--- a/ipa-server/ipa-gui/ipa_webgui Wed Jan 30 09:31:03 2008 -0500 >+++ b/ipa-server/ipa-gui/ipa_webgui Wed Jan 30 11:55:33 2008 -0500 >@@ -18,6 +18,30 @@ > # > > import os, sys >+from optparse import OptionParser >+import ipa.config >+import traceback >+import logging >+ >+def usage(): >+ print "ipa_webgui [-f|--foreground] [-d|--debug]" >+ sys.exit(1) >+ >+def parse_options(): >+ parser = OptionParser() >+ parser.add_option("-f", "--foreground", dest="foreground", >+ action="store_true", default=False, >+ help="Remain in the foreground") >+ parser.add_option("-d", "--debug", dest="debug", action="store_true", >+ default=False, >+ help="Increase the amount of logging information") >+ parser.add_option("--usage", action="store_true", >+ help="Program usage") >+ >+ args = ipa.config.init_config(sys.argv) >+ options, args = parser.parse_args(args) >+ >+ return options, args > > def daemonize(): > # fork once so the parent can exit >@@ -64,14 +88,31 @@ def daemonize(): > os.open("/dev/null", os.O_RDWR) > > def main(): >+ options, args = parse_options() >+ >+ foreground = options.foreground >+ >+ if options.debug: >+ loglevel = logging.DEBUG >+ else: >+ loglevel = logging.WARN >+ > # To make development easier, we detect if we are in the development > # environment to load a different configuration and avoid becoming > # a daemon > devel = False > if os.path.exists(os.path.join(os.path.dirname(__file__), "Makefile.am")): > devel = True >+ foreground = True >+ logging.basicConfig(level=loglevel, >+ stream=sys.stderr) >+ else: >+ # This log file name needs to be kept in sync with the one in >+ # ipa_webgui.cfg >+ logging.basicConfig(level=loglevel, >+ filename='/var/log/ipa_error.log') > >- if not devel: >+ if not foreground: > try: > daemonize() > except Exception, e: >@@ -84,7 +125,6 @@ def main(): > import pkg_resources > pkg_resources.require("TurboGears") > pkg_resources.require("ipa_gui") >- > > from turbogears import update_config, start_server > import cherrypy >@@ -105,6 +145,14 @@ def main(): > > try: > main() >+ sys.exit(0) >+except SystemExit, e: >+ sys.exit(e) > except Exception, e: >- print "failed to start web gui: %s" % str(e) >+ message = "failed to start web gui: %s" % str(e) >+ print message >+ for str in traceback.format_tb(sys.exc_info()[2]): >+ message = message + "\n" + str >+ logging.error(message) >+ > sys.exit(1)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 430011
: 293450