1.\" $NetBSD: services_mkdb.8,v 1.12 2010/05/05 22:11:19 wiz Exp $ 2.\" 3.\" Copyright (c) 1999 The NetBSD Foundation, Inc. 4.\" All rights reserved. 5.\" 6.\" This code is derived from software contributed to The NetBSD Foundation 7.\" by Luke Mewburn. 8.\" 9.\" Redistribution and use in source and binary forms, with or without 10.\" modification, are permitted provided that the following conditions 11.\" are met: 12.\" 1. Redistributions of source code must retain the above copyright 13.\" notice, this list of conditions and the following disclaimer. 14.\" 2. Redistributions in binary form must reproduce the above copyright 15.\" notice, this list of conditions and the following disclaimer in the 16.\" documentation and/or other materials provided with the distribution. 17.\" 18.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 19.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 20.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 21.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 22.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28.\" POSSIBILITY OF SUCH DAMAGE. 29.\" 30.Dd May 5, 2010 31.Dt SERVICES_MKDB 8 32.Os 33.Sh NAME 34.Nm services_mkdb 35.Nd generate the services databases 36.Sh SYNOPSIS 37.Nm 38.Op Fl qv 39.Op Fl o Ar database 40.Op Fl V Ar style 41.Op Ar file 42.Nm 43.Fl u 44.Op Ar file 45.Sh DESCRIPTION 46.Nm 47creates a 48.Xr db 3 49database for the specified file. 50If no file is specified, then 51.Pa /etc/services 52is used. 53The database is installed into 54.Pa /var/db/services.cdb 55for CDB format and into 56.Pa /var/db/services.db 57for DB format (see 58.Fl V ) . 59The file must be in the correct format (see 60.Xr services 5 ) . 61.Pp 62The options are as follows: 63.Bl -tag -width indent 64.It Fl o Ar database 65Put the output databases in the named file. 66.It Fl q 67Don't warn about duplicate services. 68This is the default behavior. 69.It Fl u 70Print the services file to stdout, omitting duplicate entries and comments. 71.It Fl V 72Create a specific version of the database style. 73.Ar style 74can be 75.Li cdb 76to request the CDB format (default) or 77.Li db 78to request the DB format. 79The DB format is useful for compatibility with old statically 80linked binaries. 81.It Fl v 82Warn about duplicate services. 83.El 84.Pp 85The databases are used by the C library services routines (see 86.Xr getservent 3 ) . 87.Pp 88.Nm 89exits zero on success, non-zero on failure. 90.Sh FILES 91.Bl -tag -width 24n -compact 92.It Pa /var/db/services.db 93The current services database. 94.It Pa /var/db/services.db.tmp 95A temporary file. 96.It Pa /etc/services 97The current services file. 98.El 99.Sh SEE ALSO 100.Xr db 3 , 101.Xr getservent 3 , 102.Xr services 5 103.Sh BUGS 104Because 105.Nm 106guarantees not to install a partial destination file it must 107build a temporary file in the same file system and if successful use 108.Xr rename 2 109to install over the destination file. 110.Pp 111If 112.Nm 113fails it will leave the previous version of the destination file intact. 114