LFCS · Question #148
After modifying the indexes for a database in slapd.conf - and running slapindex - the slapd daemon refuses to start when its init script is called. What is the most likely cause of this?
The correct answer is D. The init script is starting slapd as an ordinary user, and the index files are owned by root. When slapindex is run as root, it creates index files with root ownership, which prevents slapd from starting if the init script attempts to run it as a less privileged user.
Question
Options
- AThe indexes are not compatible with the init script.
- BThe init script cannot be run after executing slapindex, without first signing the indexes with slapsign.
- CThe init script has identified one or more invalid indexes.
- DThe init script is starting slapd as an ordinary user, and the index files are owned by root.
How the community answered
(31 responses)- A6% (2)
- B6% (2)
- C3% (1)
- D84% (26)
Why each option
When `slapindex` is run as root, it creates index files with root ownership, which prevents `slapd` from starting if the init script attempts to run it as a less privileged user.
Index compatibility with an init script is not a direct technical concern; the init script's primary role is to start the daemon, not to interact directly with index file formats.
`slapsign` is not a standard OpenLDAP utility, nor is there a requirement to 'sign' indexes for `slapd` to start after `slapindex` has been run.
While invalid indexes could prevent `slapd` from starting, `slapindex` itself is designed to build valid indexes based on the configuration; a more common post-`slapindex` issue with startup is file permissions, not often inherent index invalidity.
If `slapindex` is executed as the root user, the generated index files will be owned by root; when the `slapd` daemon is subsequently started by its init script, it often runs as a non-privileged user (e.g., `ldap` or `openldap`) who would lack read/write permissions to these root-owned files, causing startup failure.
Concept tested: OpenLDAP index file permissions after slapindex
Source: https://www.openldap.org/doc/admin24/appendix-a.html#FileOwnership
Topics
Community Discussion
No community discussion yet for this question.