SLAPINDEX(8C)

πŸŽ€ SLAPINDEX β€” bestie edition πŸ’…

okay so you're in the SLAPINDEX(8C) zone, which means we're reindexing entries in a SLAPD database. yes, that slapd. sit down, hydrate, we're doing this. ✨


✨ NAME ✨

slapindex β€” girl, we are reindexing entries in a SLAPD database. that's the whole vibe. πŸ¦‹


🌸 SYNOPSIS 🌸

/usr/bin/slapindex [-b suffix] [-c] [-d debug-level] [-f slapd.conf]
[-F confdir] [-g] [-n dbnum] [-o option[=value]] [-q] [-t] [-v]
[attr[...]]

like, that's the shape of it. every flag gets its own little moment below, don't worry. πŸ’–


πŸ’« DESCRIPTION πŸ’«

so slapindex is what you call when you need to regenerate slapd(8) indices based on what's currently sitting in a database. not what used to be there, not what you wish was there β€” the current contents. it opens the database you point it at, whether you point at it via the database number or the suffix, and then it updates the indices for all values of all attributes of all entries. all of them. the whole roster. πŸ’…

but wait β€” if you hand it a list of specific attributes on the command line? then it only regenerates the indices for those attributes. queen behavior honestly, targeted and efficient.

also kinda important: databases that are configured as subordinate to this one get re-indexed too β€” unless you pass -g. remember that.

🫢 big heads up bestie: all files that slapindex eventually creates will belong to the identity slapindex is run as. so either run slapindex with the same identity that slapd(8) will be run as (peep option -u in slapd(8)), or go change the file ownership before you run slapd(8). do not skip this, it's giving permission-denied breakdown energy 😭

⭐ OPTIONS ⭐

  • -b suffix β€” use this suffix to figure out which database you're generating output for. by default, the first database that supports the requested operation gets used. πŸŽ€ ngl: -b cannot be used together with the -n option.
  • -c β€” enable continue (ignore errors) mode. she keeps going even when things are messy. πŸ’…
  • -d debug-level β€” enable debugging messages as defined by the debug-level you give. for the deets, see slapd(8). πŸ”₯
  • -f slapd.conf β€” specify an alternative slapd.conf(5) file. your config, your rules.
  • -F confdir β€” specify a config directory. and listen, this one has layers:
    • if you specify both -f and -F, the config file gets read and converted into config directory format and written to the directory you specified. glow-up pipeline ✨
    • if you specify neither, it tries to read the default config directory before trying the default config file.
    • if a valid config directory exists, then the default config file is ignored. she said no thank you. πŸ™ˆ
  • -g β€” disable subordinate gluing. only the specified database gets processed, and not its glued subordinates (if there are any). no plus-ones. πŸ’€
  • -n dbnum β€” generate output for the <italic>dbnum*-th database listed in the configuration file. and here's the iconic part: the config database slapd-config(5) is always the first database, so use -n 0.
-n cannot be used in conjunction with the -b option. it's one or the other, bestie, pick a lane 🚫
  • -o option[=value] β€” specify an option with a(n optional) value. the possible generic options/values are:
    • syslog=<subsystems> (see -s in slapd(8))
    • syslog-level=<level> (see -S in slapd(8))
    • syslog-user=<user> (see -l in slapd(8))
  • -q β€” enable quick (fewer integrity checks) mode. performs no consistency checks when writing the database. it does improve indexing time, but βœ‹ hear me: the database will most likely be unusable if any errors or interruptions occur. fast and fragile, iykyk. 😬
  • -t β€” enable truncate mode. truncates (empties) an index database before indexing any entries. may only be used with back-mdb. 🎯
  • -v β€” enable verbose mode. she narrates everything. 🌈

😭 LIMITATIONS 😭

your slapd(8) should not be running when you do this β€” or at the very least, not in read-write mode β€” so that the database stays consistent. no cap, this one's not optional. πŸ”’

and honestly? this command provides ample opportunity for the user to obtain and drink their favorite beverage. πŸ“ like, genuinely ample. go get your lil drink.


🌈 EXAMPLES 🌈

want to reindex your SLAPD database? give the command:

/usr/bin/slapindex

want to regenerate the index for only a specific attribute, e.g. "uid"? give the command:

/usr/bin/slapindex uid

see? easy. slay. πŸ’…


πŸ’œ SEE ALSO πŸ’œ

"OpenLDAP Administrator's Guide" (http://www.OpenLDAP.org/doc/admin/)


πŸ‘‘ ACKNOWLEDGEMENTS πŸ‘‘

OpenLDAP Software is developed and maintained by The OpenLDAP Project <http://www.openldap.org/>. and fun fact: OpenLDAP Software is derived from the University of Michigan LDAP 3.3 Release. legacy, iconique, we love her. 🫢


okay that's the whole page!! written against OpenLDAP 2.7.2, dated 2026/10/21, manual section SLAPINDEX(8C). now go reindex something responsibly, bestie β€” and remember: stop slapd first, match your identity, and hydrate. πŸ’–βœ¨πŸ¦‹πŸŒΈπŸŽ€πŸ’…

πŸ“¦ where this page comes from