Bug 1020675 - Expose instructions for configuration drop dir variables
Expose instructions for configuration drop dir variables
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine-setup (Show other bugs)
3.3.0
Unspecified Unspecified
unspecified Severity urgent
: ---
: 3.3.0
Assigned To: Alon Bar-Lev
Jiri Belka
integration
: Triaged
Depends On:
Blocks: 3.3snap2
  Show dependency treegraph
 
Reported: 2013-10-18 03:28 EDT by Jiri Belka
Modified: 2014-01-21 17:34 EST (History)
9 users (show)

See Also:
Fixed In Version: is21
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
oVirt gerrit 20379 None None None Never
oVirt gerrit 20380 None None None Never
oVirt gerrit 20381 None None None Never
oVirt gerrit 20514 None None None Never
oVirt gerrit 20515 None None None Never
oVirt gerrit 20516 None None None Never
oVirt gerrit 20799 None None None Never

  None (edit)
Description Jiri Belka 2013-10-18 03:28:50 EDT
Description of problem:
rhevm-tools claims its ownership of /etc/ovirt-engine/notifier/notifier.conf but such file does not exist. And it is mentioned in Admin Guide and an admin is supposed to edit this file to override defaults.

# rpm -ql rhevm-tools | grep '/etc/.*notifier.conf'
/etc/ovirt-engine/notifier/notifier.conf
/etc/ovirt-engine/notifier/notifier.conf.d

# ls -l /etc/ovirt-engine/notifier/notifier.conf
ls: cannot access /etc/ovirt-engine/notifier/notifier.conf: No such file or directory

# ls -l /etc/ovirt-engine/notifier/notifier.conf.d/
total 4
# cat /etc/ovirt-engine/notifier/notifier.conf.d/10-setup-jboss.conf 
JBOSS_HOME="/usr/share/jbossas"

Version-Release number of selected component (if applicable):
is19

How reproducible:
100%

Steps to Reproduce:
1. rpm -ql rhevm-tools
2. ls -l /etc/ovirt-engine/notifier/notifier.conf
3.

Actual results:
/etc/ovirt-engine/notifier/notifier.conf is missing

Expected results:
should exist

Additional info:
Comment 1 Jiri Belka 2013-10-18 04:03:18 EDT
FYI, the service fails as it cannot find MAIL_SERVER defined.

I suppose it should be configured during engine-setup as rhevm-tools is installed by default. It would make sense. One question more won't kill anybody, engine-setup is already raising questions about websocket-proxy and redhat-support-plugin (which based on answer creates config file in /etc), so why not to ask if an admin is going to use notifier, if so, then ask him for his mail settings.

-%-
2013-10-18 09:55:55,979 ERROR [org.ovirt.engine.core.notifier.Notifier] Failed to run the event notification service. 
java.lang.IllegalArgumentException: Check configuration file, 'MAIL_SERVER' is missing
        at org.ovirt.engine.core.notifier.Notifier.main(Notifier.java:75)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.jboss.modules.Module.run(Module.java:292)
        at org.jboss.modules.Main.main(Main.java:455)
-%-


-%-
2013-10-18 09:55:55,943 INFO  [org.ovirt.engine.core.utils.LocalConfig] Loaded file "/etc/ovirt-engine/notifier/notifier.conf.d/10-setup-jboss.conf".
2013-10-18 09:55:55,944 INFO  [org.ovirt.engine.core.utils.LocalConfig] Value of property "DAYS_TO_KEEP_HISTORY" is "0".
2013-10-18 09:55:55,944 INFO  [org.ovirt.engine.core.utils.LocalConfig] Value of property "DAYS_TO_SEND_ON_STARTUP" is "0".
2013-10-18 09:55:55,944 INFO  [org.ovirt.engine.core.utils.LocalConfig] Value of property "ENGINE_ETC" is "/etc/ovirt-engine".
2013-10-18 09:55:55,944 INFO  [org.ovirt.engine.core.utils.LocalConfig] Value of property "ENGINE_INTERVAL_IN_SECONDS" is "300".
2013-10-18 09:55:55,945 INFO  [org.ovirt.engine.core.utils.LocalConfig] Value of property "ENGINE_LOG" is "/var/log/ovirt-engine".
2013-10-18 09:55:55,945 INFO  [org.ovirt.engine.core.utils.LocalConfig] Value of property "ENGINE_MONITOR_RETRIES" is "3".
2013-10-18 09:55:55,945 INFO  [org.ovirt.engine.core.utils.LocalConfig] Value of property "ENGINE_PID" is "/var/lib/ovirt-engine/ovirt-engine.pid".
2013-10-18 09:55:55,945 INFO  [org.ovirt.engine.core.utils.LocalConfig] Value of property "ENGINE_TIMEOUT_IN_SECONDS" is "30".
2013-10-18 09:55:55,945 INFO  [org.ovirt.engine.core.utils.LocalConfig] Value of property "ENGINE_USR" is "/usr/share/ovirt-engine".
2013-10-18 09:55:55,946 INFO  [org.ovirt.engine.core.utils.LocalConfig] Value of property "FAILED_QUERIES_NOTIFICATION_RECIPIENTS" is "".
2013-10-18 09:55:55,946 INFO  [org.ovirt.engine.core.utils.LocalConfig] Value of property "FAILED_QUERIES_NOTIFICATION_THRESHOLD" is "30".
2013-10-18 09:55:55,972 INFO  [org.ovirt.engine.core.utils.LocalConfig] Value of property "HTML_MESSAGE_FORMAT" is "false".
2013-10-18 09:55:55,972 INFO  [org.ovirt.engine.core.utils.LocalConfig] Value of property "INTERVAL_IN_SECONDS" is "120".
2013-10-18 09:55:55,972 INFO  [org.ovirt.engine.core.utils.LocalConfig] Value of property "IS_HTTPS_PROTOCOL" is "false".
2013-10-18 09:55:55,973 INFO  [org.ovirt.engine.core.utils.LocalConfig] Value of property "JBOSS_HOME" is "/usr/share/jbossas".
2013-10-18 09:55:55,973 INFO  [org.ovirt.engine.core.utils.LocalConfig] Value of property "MAIL_ENABLE_SSL" is "false".
2013-10-18 09:55:55,973 INFO  [org.ovirt.engine.core.utils.LocalConfig] Value of property "MAIL_FROM" is "".
2013-10-18 09:55:55,973 INFO  [org.ovirt.engine.core.utils.LocalConfig] Value of property "MAIL_PASSWORD" is "".
2013-10-18 09:55:55,974 INFO  [org.ovirt.engine.core.utils.LocalConfig] Value of property "MAIL_PORT" is "25".
2013-10-18 09:55:55,974 INFO  [org.ovirt.engine.core.utils.LocalConfig] Value of property "MAIL_PORT_SSL" is "465".
2013-10-18 09:55:55,974 INFO  [org.ovirt.engine.core.utils.LocalConfig] Value of property "MAIL_REPLY_TO" is "".
2013-10-18 09:55:55,974 INFO  [org.ovirt.engine.core.utils.LocalConfig] Value of property "MAIL_SERVER" is "".
2013-10-18 09:55:55,975 INFO  [org.ovirt.engine.core.utils.LocalConfig] Value of property "MAIL_USER" is "".
2013-10-18 09:55:55,975 INFO  [org.ovirt.engine.core.utils.LocalConfig] Value of property "NOTIFIER_STOP_INTERVAL" is "1".
2013-10-18 09:55:55,975 INFO  [org.ovirt.engine.core.utils.LocalConfig] Value of property "NOTIFIER_STOP_TIME" is "30".
2013-10-18 09:55:55,975 INFO  [org.ovirt.engine.core.utils.LocalConfig] Value of property "REPEAT_NON_RESPONSIVE_NOTIFICATION" is "false".
2013-10-18 09:55:55,976 INFO  [org.ovirt.engine.core.utils.LocalConfig] Value of property "SSL_IGNORE_CERTIFICATE_ERRORS" is "false".
2013-10-18 09:55:55,976 INFO  [org.ovirt.engine.core.utils.LocalConfig] Value of property "SSL_IGNORE_HOST_VERIFICATION" is "false".
2013-10-18 09:55:55,976 INFO  [org.ovirt.engine.core.utils.LocalConfig] Value of property "SSL_PROTOCOL" is "TLS".
-%-

-%-
# egrep -v "^[ \t]*$|^#" /usr/share/ovirt-engine/services/ovirt-engine-notifier/ovirt-engine-notifier.conf 
JBOSS_HOME="/usr/share/jbossas"
ENGINE_ETC="/etc/ovirt-engine"
ENGINE_LOG="/var/log/ovirt-engine"
ENGINE_USR="/usr/share/ovirt-engine"
NOTIFIER_STOP_TIME=30
NOTIFIER_STOP_INTERVAL=1
INTERVAL_IN_SECONDS=120
MAIL_SERVER=
MAIL_PORT=25
MAIL_PORT_SSL=465
MAIL_USER=
MAIL_PASSWORD=
MAIL_ENABLE_SSL=false
HTML_MESSAGE_FORMAT=false
MAIL_FROM=
MAIL_REPLY_TO=
DAYS_TO_KEEP_HISTORY=0
DAYS_TO_SEND_ON_STARTUP=0
FAILED_QUERIES_NOTIFICATION_THRESHOLD=30
FAILED_QUERIES_NOTIFICATION_RECIPIENTS=
ENGINE_INTERVAL_IN_SECONDS=300
ENGINE_MONITOR_RETRIES=3
ENGINE_TIMEOUT_IN_SECONDS=30
IS_HTTPS_PROTOCOL=false
SSL_PROTOCOL=TLS
SSL_IGNORE_CERTIFICATE_ERRORS=false
SSL_IGNORE_HOST_VERIFICATION=false
REPEAT_NON_RESPONSIVE_NOTIFICATION=false
-%-
Comment 2 Alon Bar-Lev 2013-10-20 04:06:33 EDT
(In reply to Jiri Belka from comment #0)
> Description of problem:
> rhevm-tools claims its ownership of /etc/ovirt-engine/notifier/notifier.conf
> but such file does not exist. And it is mentioned in Admin Guide and an
> admin is supposed to edit this file to override defaults.

The notifier is aligned to ovirt-engine configuration using drop dir.

The /etc/ovirt-engine/notifier/notifier.conf remained as ghost to allow previous configuration to outlive upgrade.

(In reply to Jiri Belka from comment #1)
> FYI, the service fails as it cannot find MAIL_SERVER defined.
> 
> I suppose it should be configured during engine-setup as rhevm-tools is
> installed by default. It would make sense. One question more won't kill
> anybody, engine-setup is already raising questions about websocket-proxy and
> redhat-support-plugin (which based on answer creates config file in /etc),
> so why not to ask if an admin is going to use notifier, if so, then ask him
> for his mail settings.

There can be no default to MAIL_SERVER and as far as I know the notifier has service always configured manually.

Unlike the websocket proxy, the notifier is not required feature for product core features. So I am unsure about adding it to setup. If you think it should be added, please open a separate RFE for it, most likely it will not happen for 3.3.

Thanks!
Comment 3 Barak 2013-10-20 07:50:23 EDT
can't we add an example conf file ?
Comment 4 Alon Bar-Lev 2013-10-20 08:18:34 EDT
(In reply to Barak from comment #3)
> can't we add an example conf file ?

No need, all variables available at /usr/share/ovirt-engine/services/ovirt-engine-notifier/ovirt-engine-notifier.conf which serve as default file. Sames goes to any other service we have.
Comment 5 Barak 2013-10-21 13:53:59 EDT
(In reply to Alon Bar-Lev from comment #4)
> (In reply to Barak from comment #3)
> > can't we add an example conf file ?
> 
> No need, all variables available at
> /usr/share/ovirt-engine/services/ovirt-engine-notifier/ovirt-engine-notifier.
> conf which serve as default file. Sames goes to any other service we have.

Jiri has a point here,

So either we have a commented example conf file,
Or have it configured as a part of setup or a separate utility.
The customer should not guess the parameters.
Comment 6 Alon Bar-Lev 2013-10-21 14:00:23 EDT
(In reply to Barak from comment #5)
> (In reply to Alon Bar-Lev from comment #4)
> > (In reply to Barak from comment #3)
> > > can't we add an example conf file ?
> > 
> > No need, all variables available at
> > /usr/share/ovirt-engine/services/ovirt-engine-notifier/ovirt-engine-notifier.
> > conf which serve as default file. Sames goes to any other service we have.
> 
> Jiri has a point here,
> 
> So either we have a commented example conf file,
> Or have it configured as a part of setup or a separate utility.
> The customer should not guess the parameters.

if you want to configure this during setup, please file RFE, as it was never supported, and this is new request, unrelated to this bug.

Maintaining commented file is incorrect, as it tend to be out of sync, and user tend to update the template, which is incorrect as it cause problem when updating packages as template changes.

Maintaining commented file is confusing as using drop dir makes it possible to have multiple configuration file example:

/etc/ovirt-engine/notifier/notifier.conf.d/50-mail-server.conf
---
MAIL_SERVER=smtp.google.com
---

What we can do is add README within /etc/ovirt-engine/engine.conf.d and /etc/ovirt-engine/notifier/notifier.conf.d referring the defaults file.
Comment 7 Jiri Belka 2013-10-21 17:58:17 EDT
(In reply to Barak from comment #5)
> (In reply to Alon Bar-Lev from comment #4)
> > (In reply to Barak from comment #3)
> > > can't we add an example conf file ?
> > 
> > No need, all variables available at
> > /usr/share/ovirt-engine/services/ovirt-engine-notifier/ovirt-engine-notifier.
> > conf which serve as default file. Sames goes to any other service we have.
> 
> Jiri has a point here,
> 
> So either we have a commented example conf file,
> Or have it configured as a part of setup or a separate utility.
> The customer should not guess the parameters.

My point was the existence of the conf file. The conf file is described in the Admin Guide but it does not exist. I do not understand what's so problematic to behave like normally like any daemon - while installing a package, example conf file is placed into /etc, if files is untouched then it is updated if needed during upgrade. Why to reinvent wheel? Imagine you would install for example postfix and you would know there should be conf files in /etc/postfix but this dir would not exist. Pretty stupid right? No an admin have to find where to get such config files... This was my point.
Comment 8 Alon Bar-Lev 2013-10-22 02:31:48 EDT
1. admin guide should be updated.

2. 'normal daemon' is not installing example conf into /etc, not any more, it crated too much issues when updating packages (the rpmsave, rpmnew hell). what you refer is the old 'normal daemon' approach. current daemons have documentation of what can be specified in configuration, while user puts only the variables he needs in drop dir that is not overridden by future updates, hence ease maintenance.
Comment 9 Alon Bar-Lev 2013-10-22 04:18:55 EDT
packaging: setup: add README file to configuration drop dirs

This adds:

/etc/ovirt-engine/notifier/notifier.conf.d/README
/etc/ovirt-engine/ovirt-websocket-proxy.conf.d/README
/etc/ovirt-engine/engine.conf.d/README

With the following text:

---
xxxx service configuration directory

Only *.conf are considered.

Files are sorted by name, last wins.

Variables available at:

  /usr/share/ovirt-engine/services/xxx/xxx.conf
---

I think this should settle the gap.
Comment 10 Jiri Belka 2013-11-01 05:39:12 EDT
ok is21, README file exists. I doubt this is the best approach... Administration Guide was _not_ updates.

2013-11-01 10:13:08,577 WARN  [org.ovirt.engine.core.utils.LocalConfig] The file "/etc/ovirt-engine/notifier/notifier.conf" doesn't exist or isn't readable. Will return an empty set of properties.
Comment 11 Alon Bar-Lev 2013-11-01 06:24:42 EDT
(In reply to Jiri Belka from comment #10)
> ok is21, README file exists. I doubt this is the best approach...
> Administration Guide was _not_ updates.

This is documentation bug, no?

> 2013-11-01 10:13:08,577 WARN  [org.ovirt.engine.core.utils.LocalConfig] The
> file "/etc/ovirt-engine/notifier/notifier.conf" doesn't exist or isn't
> readable. Will return an empty set of properties.

This is fine.

Thanks!
Comment 12 Itamar Heim 2014-01-21 17:31:53 EST
Closing - RHEV 3.3 Released
Comment 13 Itamar Heim 2014-01-21 17:31:54 EST
Closing - RHEV 3.3 Released
Comment 14 Itamar Heim 2014-01-21 17:34:30 EST
Closing - RHEV 3.3 Released

Note You need to log in before you can comment on or make changes to this bug.