SERVICES(8)

NAME
services - utility to programmatically edit the services database

SYNOPSIS
services [-K services_file] add name port [alias ...]
services [-K services_file] check (name|port) | name port
services [-K services_file] list
services [-K services_file] remove name port

DESCRIPTION
services is a utility that allows the system administrator to programmatically edit the services(5) database. It is specially designed to be integrated into packaging systems to allow them to register and unregister services from the services file.

Whenever possible, the utility attempts to preserve existing comments in the file. The utility does not validate the syntax of existing files; it assumes they are valid.

The following options are available:

-K services_file
    Path to the services(5) database to access. Defaults to /etc/services if not specified.

The following commands are available:

add name port [alias ...]
    Adds the service name port, with the optional set of aliases specified by alias ..., to the services file.

    If the name port combination or if the port by itself are already listed in the services file, an error is raised.

    If the services file does not exist, it is created.

check (name|port) | name port
    Verifies if name, port, or the combination name port are listed in the services file.

list
    Lists all services registered in the services file.

remove name port
    Removes the service name port from the services file.

    If the name port combination is not listed in the services file, an error is raised.

    If the services file turns out to be completely empty after the removal of the service, the file is removed. Note that if the file is left with comments in it but with no services, it is not removed.

FILES
/etc/services
    Default services(5) file.

DIAGNOSTICS
The add, list and remove commands return 0 on success and any non-zero value on failure.

The check command returns 0 if the shell is found in the services file and 1 otherwise.

SEE ALSO
services(5)

AUTHORS
The services command was developed by Julio Merino <jmmv@NetBSD.org>.