Bug 1520373
| Summary: | Systemd does not start the log pipe from environment file | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 9 | Reporter: | Marc Muehlfeld <mmuehlfe> | ||||
| Component: | 389-ds-base | Assignee: | LDAP Maintainers <idm-ds-dev-bugs> | ||||
| Status: | NEW --- | QA Contact: | LDAP QA Team <idm-ds-qe-bugs> | ||||
| Severity: | low | Docs Contact: | |||||
| Priority: | low | ||||||
| Version: | 9.1 | CC: | idm-ds-dev-bugs, mreynolds, nkinder, pasik, spichugi, tbordaz, vashirov, vmishra, ypismerov | ||||
| Target Milestone: | rc | Keywords: | Triaged | ||||
| Target Release: | 9.3 | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Whiteboard: | sync-to-jira | ||||||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |||||
| 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: | --- | Target Upstream Version: | |||||
| Embargoed: | |||||||
| Attachments: |
|
||||||
|
Description
Marc Muehlfeld
2017-12-04 11:25:15 UTC
Created attachment 1362652 [details] Documentation from the RHDS Admin Guide Because this does not work at the moment, I removed the > 19.5. Replacing Log Files with a Named Pipe section from the RHDS Admin Guide (BZ#1504764). In case you need the documentation to reproduce the problem, I attached a PDF version of the section to this BZ. logpipe works with the following configuration: 1. Edit systemd service for the instance: # systemctl edit --full dirsrv@localhost Add in [Unit] section: Wants=dirsrv-logpipe@.service 2. Create a new unit file for ds-logpipe (access, error and audit logs should all have separate services) # cat > /usr/lib/systemd/system/dirsrv-logpipe@.service << EOF [Unit] Description=389 Directory Server Logpipe %i. PartOf=dirsrv.target Before=dirsrv@.service [Service] Type=simple NotifyAccess=all PIDFile=/run/dirsrv/slapd-%i-logpipe.pid ExecStart=/usr/bin/python /usr/bin/ds-logpipe.py /var/log/dirsrv/slapd-%i/access.pipe -m 1000 -u dirsrv -s /run/dirsrv/slapd-%i.pid [Install] WantedBy=multi-user.target EOF 3. Reload systemd and enable new service # systemctl daemon-reload # systemctl enable dirsrv-logpipe@localhost 4. Update settings for access log so that pipe file won't expire and won't be rotated: # dsconf localhost config replace nsslapd-accesslog-maxlogsperdir=1 # dsconf localhost config replace nsslapd-accesslog-logexpirationtime=-1 # dsconf localhost config replace nsslapd-accesslog-logrotationtime=-1 # dsconf localhost config replace nsslapd-accesslog=/var/log/dirsrv/slapd-localhost/access.pipe # dsconf localhost config replace nsslapd-accesslog-logbuffering=off 5. Stop dirsrv and remove /var/log/dirsrv/slapd-localhost/access.pipe created by dirsrv (it will be recreated by the dirsrv-logpipe service) # systemctl stop dirsrv@localhost # rm -f /var/log/dirsrv/slapd-localhost/access.pipe 6. Start dirsrv service, with the changes above it should automatically pick up new service and start it: # systemctl start dirsrv@localhost # ps -ef | grep [s]lapd dirsrv 7335 1 0 06:32 ? 00:00:00 /usr/bin/python /usr/bin/ds-logpipe.py /var/log/dirsrv/slapd-localhost/access.pipe -m 1000 -u dirsrv -s /run/dirsrv/slapd-localhost.pid dirsrv 7346 1 2 06:32 ? 00:00:00 /usr/sbin/ns-slapd -D /etc/dirsrv/slapd-localhost -i /run/dirsrv/slapd-localhost.pid And the logpipe service is automatically stopped when the instance is stopped too: # systemctl stop dirsrv@localhost # ps -ef | grep [s]lapd -c 0 I think we can ship these systemd unit files as part of our rpm, but I have doubts if we should do this because of how obscure this feature is. But maybe if we add back documentation for it and ship these files, it would become more popular :) Also, some ds tools rely on log files being actual files and not pipes (for example healthcheck hangs trying to read log files), so we would need to add more changes and do more testing for a feature that is used very little. An alternative to logpipe is to use log buffering for all log types: https://github.com/389ds/389-ds-base/issues/5842. Moving to 9.4 for now. |