services_mkdb(8)

services_mkdb8

Generate the services database

Usage

services_mkdb [{-b | -l}] [-q] [-o database] [file]

services_mkdb -u [file]

Overview

The services_mkdb utility creates a db(3) database for the specified file. If no file is specified, then /etc/services is used. The database is installed into /var/db/services.db. The file must be in the correct format (see services(5)).

The options are as follows:

-b

Use big-endian byte order for database metadata.

-l

Use little-endian byte order for database metadata.

-o database

Put the output databases in the named file.

-q

Do not warn about duplicate services.

-u

Print the services file to stdout, omitting duplicate entries and comments.

The databases are used by the C library services routines (see getservent(3)).

The -b and -l flags are mutually exclusive. The default byte ordering is the current host order.

Files

/var/db/services.db

The current services database.

/var/db/services.db.tmp

A temporary file.

/etc/services

The current services file.

Exit status

The services_mkdb utility exits 0 on success, and >0 if an error occurs.

Releases

38 releases since FreeBSD 8.1-RELEASE; the text changed 24 times.

  1. 8.1
  2. 8.2
  3. 8.3
  4. 8.4
  5. 9.0
  6. 9.1
  7. 9.2
  8. 9.3
  9. 10.0
  10. 10.1
  11. 10.2
  12. 10.3
  13. 10.4
  14. 11.0
  15. 11.1
  16. 11.2
  17. 11.3
  18. 11.4
  19. 12.0
  20. 12.1
  21. 12.2
  22. 12.3
  23. 12.4
  24. 13.0–13.2
  25. 13.3–16.0

-b since FreeBSD 10.1-RELEASE; -l since FreeBSD 10.1-RELEASE.

Bugs

Because services_mkdb guarantees not to install a partial destination file it must build a temporary file in the same file system and if successful use rename(2) to install over the destination file.

If services_mkdb fails it will leave the previous version of the destination file intact.

From base 16.0-CURRENT-20261027-61c70dc16a79 in FreeBSD 16.0-CURRENT (2026-10-27). Parsed by carta from the page's mdoc source.