Hi Nick
Nick Milas nick@eurobjects.com hat am 21.05.2025 10:48 CEST geschrieben:
I have managed to start the migrated LDAP server on Rocky 9, v2.6.9 LTB.
[....]
As a side note, I see that logging is directed to the journal. Could I redirect it to a file instead? I have set olcLogFile, but logging is directed to the journal nevertheless.
As you use the LTB Projects packages you should have a slapd-cli.conf file. On my RHEL server that is here /usr/local/openldap/etc/openldap/slapd-cli.conf. In that conf file you can set the syslog facility, in my case local4 like so:
SLAPD_SYSLOG_LOCAL_USER="local4"
To activate this setting you need to perform a "slapd-cli restoreconfig" but if you're not familiar with what that does you need to read up on it first: https://ltb-project.org/documentation/slapd-cli.html#usage-of-slapd-cli
Then as you probably also have rsyslog installed you need to configure it to write local4 messages to a file. In my case I created a file /etc/rsyslog.d/ldap.conf with this content:
if prifilt("local4.*") then { action(type="omfile" file="/var/log/openldap/ldap.log" Template="RSYSLOG_FileFormat") stop }
That way rsyslog picks up the log-messages with local4 facility and writes them to /var/log/openldap/ldap.log. You need to restart rsyslog for this change to take effect and ensure the directory /var/log/openldap exists if rsyslog cannot create it.
Hope that helps, Cyril