Bug 1625005

Summary: Document realmd.conf and how realmd reads the configuration
Product: Red Hat Enterprise Linux 7 Reporter: Erinn Looney-Triggs <erinn.looneytriggs>
Component: realmdAssignee: Sumit Bose <sbose>
Status: CLOSED ERRATA QA Contact: sssd-qe <sssd-qe>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 7.5CC: sgadekar, sgoveas, thalman
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard: sync-to-jira
Fixed In Version: realmd-0.16.1-12.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1747456 (view as bug list) Environment:
Last Closed: 2020-09-29 20:35:34 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:
Bug Depends On:    
Bug Blocks: 1747456    

Description Erinn Looney-Triggs 2018-09-03 23:02:18 UTC
Description of problem:
There are mentions that /etc/realmd.conf can be used to fill in most of the information (https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/windows_integration_guide/realmd-conf https://freedesktop.org/software/realmd/docs/realmd-conf.html) that can be put in on the command line. However, when running an strace on realm it never even seems to check that the file is there let alone open it. Does realmd.conf work? If not please fix it, if so and I am doing something wrong, can we please document how it should work?


Version-Release number of selected component (if applicable):
realmd-0.16.1-9.el7.x86_64

How reproducible:


Steps to Reproduce:
1. Create a /etc/realmd.conf with options
2. run realm join
3. Watch it ignore any of the options since it doesn't seem to open the file

Actual results:
Ignores and in fact doesn't even appear to open /etc/realmd.conf


Additional info:
ls -l /etc/realmd.conf 
-rw-r--r--. 1 root root 269 Sep  3 15:44 /etc/realmd.conf

cat /etc/realmd.conf
[active-directory]
default-client = winbind

[users]
default-home = /home/%U

[ad.colorado.edu]
computer-ou = OU=Computers,OU=OIT - UnixOps,OU=SIS,OU=ITS,OU=,DC=ad,DC=example,DC=com
automatic-id-mapping = no
fully-qualified-names = no

Comment 2 Sumit Bose 2018-09-04 07:44:40 UTC
Hi,

/etc/realmd.conf is not read by the realm command but by the realmd daemon at startup. There should be log messages in the journal or /var/log/meesages saying

    realmd[24457]: Loaded settings from: /usr/lib/realmd/realmd-defaults.conf /usr/lib/realmd/realmd-distro.conf

or 

    realmd[24539]: Loaded settings from: /usr/lib/realmd/realmd-defaults.conf /usr/lib/realmd/realmd-distro.conf /etc/realmd.conf

depending on the existence of /etc/realmd.conf

The realmd daemon is be default started automatically if there are some DBus request pending, typically send by the realm command, and it will also shutdown automatically after about 1 minute of inactivity. But if while editing options in /etc/realmd.conf you call the realm command again inside this timeout window the realmd daemon will still run with the old settings read at startup.

In this case you should stop or restart the realmd daemon after modifying /etc/realmd.conf with e.g. 'systemctl stop realmd' or wait until realmd was shut down automatically.

Please let me know if this helps to solve the issues you are seeing.

bye,
Sumit

Comment 3 Erinn Looney-Triggs 2018-09-04 21:53:00 UTC
Thanks systemctl realmd stop seems to do the trick. If possible can this information be documented in the man page, and the two aforementioned locations for future users?

-Erinn

Comment 4 Sumit Bose 2019-12-03 10:20:05 UTC
Upstream:
 - 98a69ca00e3441128b181b59c06bb06e8c362360

Comment 8 shridhar 2020-05-19 12:12:34 UTC
Tested with following data:

 ~]# rpm -q realmd
realmd-0.16.1-12.el7.x86_64


<snip>

REALMD.CONF(5)                                                                               File Formats                                                                               REALMD.CONF(5)

NAME
       realmd.conf - Tweak behavior of realmd

CONFIGURATION FILE
       realmd can be tweaked by network administrators to act in specific ways. This is done by placing settings in a /etc/realmd.conf. This file does not exist by default. The syntax of this file
       is the same as an INI file or Desktop Entry file. If the file is changed and realmd is running realmd must be restarted to read the new values.

       Only specify the settings you wish to override in the /etc/realmd.conf file. Settings not specified will be loaded from their packaged defaults which can be found in
       /usr/lib64/realmd/realmd-defaults.conf and /usr/lib64/realmd/realmd-distro.conf. Only override the settings below. You may find other settings if you look through the realmd source code.
       However these are not guaranteed to remain stable.

</snip>


Marking verified.

Comment 10 errata-xmlrpc 2020-09-29 20:35:34 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (realmd bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:4014