Bug 1230124
| Summary: | ovirt-engine.py uses env variables | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Virtualization Manager | Reporter: | Pavel Zhukov <pzhukov> |
| Component: | ovirt-engine | Assignee: | Yedidyah Bar David <didi> |
| Status: | CLOSED NOTABUG | QA Contact: | Pavel Stehlik <pstehlik> |
| Severity: | urgent | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 3.5.1 | CC: | alonbl, ecohen, lpeer, lsurette, oourfali, pzhukov, rbalakri, Rhev-m-bugs, sbonazzo, yeylon |
| Target Milestone: | --- | ||
| Target Release: | 3.5.4 | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | integration | ||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2015-06-22 05:44:28 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
should use /etc/sysconfig/ovirt-engine to control the environment. I think Alon is correct, please use /etc/sysconfig/ovirt-engine for setting OVIRT_SERVICE_DEBUG=1 instead of exporting the variable. (In reply to Sandro Bonazzola from comment #4) > I think Alon is correct, please use /etc/sysconfig/ovirt-engine for setting > OVIRT_SERVICE_DEBUG=1 instead of exporting the variable. For sure I've tried this approach I have this: [root@rhevm engine.conf.d]# cat /etc/ovirt-engine/engine.conf.d/10-debug.conf OVIRT_SERVICE_DEBUG=1 and it doesn't work. if os.environ.get('OVIRT_SERVICE_DEBUG', '0') != '0': logger.setLevel(logging.DEBUG) print("Set to debug") else: logger.setLevel(logging.INFO) print("Set to info") << == !!!! /ssh:root.85.107: #$ service ovirt-engine restart Stopping oVirt Engine: [60G[ OK ] Starting oVirt Engine: Set to info << !!!! [60G[ OK ] Again, location of environment variables for service is at /etc/sysconfig/ovirt-engine Please follow instructions closely. Thanks. (In reply to Alon Bar-Lev from comment #6) > Again, location of environment variables for service is at > /etc/sysconfig/ovirt-engine > > Please follow instructions closely. > > Thanks. Alon, iirc ovirt-engine switched from using sysconfig to /etc/ovirt-engine/engine.conf.d, didn't it? Anyway: [root@rhevm ~]# service ovirt-engine restart Stopping oVirt Engine: [ OK ] Starting oVirt Engine: Set to info <<< !!!! Test logger before handler 20 [ OK ] [root@rhevm ~]# cat /etc/sysconfig/ovirt-engine OVIRT_SERVICE_DEBUG=1 https://bugzilla.redhat.com/show_bug.cgi?id=917586 [RFE] Use /etc/ovirt-engine/engine.conf for local configuration instead of /etc/sysconfig/ovirt-engine # rpm -qf /etc/sysconfig/ovirt-engine file /etc/sysconfig/ovirt-engine is not owned by any package These are two different configurations. /etc/sysconfig/ovirt-engine - environment for service. /etc/ovirt-engine/engine.conf.d - configuration for application. If you need special customization of service environment, the standard method to apply that is /etc/sysconfig/@SERVICE_NAME@. (In reply to Pavel Zhukov from comment #7) > (In reply to Alon Bar-Lev from comment #6) > > Again, location of environment variables for service is at > > /etc/sysconfig/ovirt-engine > > > > Please follow instructions closely. > > > > Thanks. > > Alon, iirc ovirt-engine switched from using sysconfig to > /etc/ovirt-engine/engine.conf.d, didn't it? > > Anyway: > [root@rhevm ~]# service ovirt-engine restart > Stopping oVirt Engine: [ OK ] > Starting oVirt Engine: Set to info <<< !!!! > Test logger before handler 20 > [ OK ] > [root@rhevm ~]# cat /etc/sysconfig/ovirt-engine > OVIRT_SERVICE_DEBUG=1 please try to export it there: OVIRT_SERVICE_DEBUG=1 export OVIRT_SERVICE_DEBUG Exporting works. |
Description of problem: ovirt-engine.py uses env variable to check if DEBUG is enabled or not. If user restart service using "service ovirt-engine restart" (recommend way btw) environment variables are cleaned up. using of "/etc/init.d/ovirt-engine restart" fixes the problem but it's not recommended way to do Version-Release number of selected component (if applicable): rhevm-backend-3.5.1.1-0.1.el6ev.noarch How reproducible: 100% Steps to Reproduce: 1. export OVIRT_SERVICE_DEBUG=1 2. service ovirt-engine restart Actual results: logger.level = 20 (INFO) Expected results: logger.level = 10 (DEBUG) Additional info: if os.environ.get('OVIRT_SERVICE_DEBUG', '0') != '0': logger.setLevel(logging.DEBUG) else: logger.setLevel(logging.INFO)