]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man5/services.5
Wrapped long lines, wrapped at sentence boundaries; stripped trailing
[thirdparty/man-pages.git] / man5 / services.5
CommitLineData
fea681da
MK
1.\" Hey Emacs! This file is -*- nroff -*- source.
2.\"
3.\" This manpage is Copyright (C) 1996 Austin Donnelly <and1000@cam.ac.uk>,
4.\" with additional material (c) 1995 Martin Schulze <joey@infodrom.north.de>
5.\"
6.\" Permission is granted to make and distribute verbatim copies of this
7.\" manual provided the copyright notice and this permission notice are
8.\" preserved on all copies.
9.\"
10.\" Permission is granted to copy and distribute modified versions of this
11.\" manual under the conditions for verbatim copying, provided that the
12.\" entire resulting derived work is distributed under the terms of a
13.\" permission notice identical to this one.
c13182ef 14.\"
fea681da
MK
15.\" Since the Linux kernel and libraries are constantly changing, this
16.\" manual page may be incorrect or out-of-date. The author(s) assume no
17.\" responsibility for errors or omissions, or for damages resulting from
18.\" the use of the information contained herein. The author(s) may not
19.\" have taken the same level of care in the production of this manual,
20.\" which is licensed free of charge, as they might when working
21.\" professionally.
c13182ef 22.\"
fea681da
MK
23.\" Formatted or processed versions of this manual, if unaccompanied by
24.\" the source, must acknowledge the copyright and authors of this work.
25.\"
26.\" This manpage was made by merging two independently written manpages,
27.\" one written by Martin Schulze (18 Oct 95), the other written by
28.\" Austin Donnelly, (9 Jan 96).
29.\"
30.\" Thu Jan 11 12:14:41 1996 Austin Donnelly <and1000@cam.ac.uk>
31.\" * Merged two services(5) manpages
32.\"
33.TH SERVICES 5 1996-01-11 "Linux" "Linux Programmer's Manual"
34.SH NAME
35services \- Internet network services list
36.SH DESCRIPTION
37.B services
38is a plain ASCII file providing a mapping between friendly textual
39names for internet services, and their underlying assigned port
c13182ef
MK
40numbers and protocol types.
41Every networking program should look into
fea681da
MK
42this file to get the port number (and protocol) for its service.
43The C library routines
44.BR getservent (3),
45.BR getservbyname (3),
46.BR getservbyport (3),
47.BR setservent (3),
c13182ef 48and
fea681da
MK
49.BR endservent (3)
50support querying this file from programs.
51
52Port numbers are assigned by the IANA (Internet Assigned Numbers
53Authority), and their current policy is to assign both TCP and UDP
c13182ef
MK
54protocols when assigning a port number.
55Therefore, most entries will
fea681da
MK
56have two entries, even for TCP only services.
57
58Port numbers below 1024 (so-called 'low numbered' ports) can only be
59bound to by root (see
60.BR bind (2),
61.BR tcp (7),
c13182ef 62and
fea681da
MK
63.BR udp (7)).
64This is so clients connecting to low numbered ports can trust
65that the service running on the port is the standard implementation,
c13182ef
MK
66and not a rogue service run by a user of the machine.
67Well-known port numbers specified by the IANA are normally
68located in this root-only space.
fea681da 69
c13182ef 70The presence of an entry for a service in the
fea681da
MK
71.B services
72file does not necessarily mean that the service is currently running
c13182ef
MK
73on the machine.
74See
fea681da 75.BR inetd.conf (5)
c13182ef
MK
76for the configuration of Internet services offered.
77Note that not all
fea681da
MK
78networking services are started by
79.BR inetd (8),
80and so won't appear in
81.BR inetd.conf (5).
82In particular, news (NNTP) and mail (SMTP) servers are often
83initialized from the system boot scripts.
84
85The location of the
86.B services
87file is defined by
88.B _PATH_SERVICES
89in
90.IR /usr/include/netdb.h "."
91This is usually set to
92.IR /etc/services "."
93
94Each line describes one service, and is of the form:
95.IP
96\f2service-name\ \ \ port\f3/\f2protocol\ \ \ \f1[\f2aliases ...\f1]
97.TP
98where:
99.TP 10
100.I service-name
c13182ef
MK
101is the friendly name the service is known by and looked up under.
102It is case sensitive.
103Often, the client program is named after the
fea681da
MK
104.IR service-name "."
105.TP
106.I port
107is the port number (in decimal) to use for this service.
108.TP
109.I protocol
c13182ef
MK
110is the type of protocol to be used.
111This field should match an entry
fea681da
MK
112in the
113.BR protocols (5)
c13182ef
MK
114file.
115Typical values include
fea681da
MK
116.B tcp
117and
118.BR udp .
119.TP
120.I aliases
121is an optional space or tab separated list of other names for this
c13182ef
MK
122service (but see the BUGS section below).
123Again, the names are case
fea681da
MK
124sensitive.
125.PP
fea681da
MK
126Either spaces or tabs may be used to separate the fields.
127
128Comments are started by the hash sign (#) and continue until the end
c13182ef
MK
129of the line.
130Blank lines are skipped.
fea681da
MK
131
132The
133.I service-name
134should begin in the first column of the file, since leading spaces are
135not stripped.
136.I service-names
c13182ef
MK
137can be any printable characters excluding space and tab.
138However, a conservative choice of characters should be used to minimize
139inter-operability problems.
140E.g., a\-z, 0\-9, and hyphen (\-) would seem a
fea681da
MK
141sensible choice.
142
143Lines not matching this format should not be present in the
c13182ef
MK
144file.
145(Currently, they are silently skipped by
fea681da
MK
146.BR getservent (3),
147.BR getservbyname (3),
148and
149.BR getservbyport (3).
150However, this behaviour should not be relied on.)
151
152As a backwards compatibility feature, the slash (/) between the
153.I port
154number and
155.I protocol
c13182ef
MK
156name can in fact be either a slash or a comma (,).
157Use of the comma in
fea681da
MK
158modern installations is depreciated.
159
160This file might be distributed over a network using a network-wide
161naming service like Yellow Pages/NIS or BIND/Hesiod.
162
163A sample
164.B services
165file might look like this:
166.RS
167.nf
168.sp
169.ta 3i
170netstat 15/tcp
171qotd 17/tcp quote
172msp 18/tcp # message send protocol
173msp 18/udp # message send protocol
174chargen 19/tcp ttytst source
175chargen 19/udp ttytst source
176ftp 21/tcp
2bc2f479 177# 22 \- unassigned
fea681da 178telnet 23/tcp
fea681da
MK
179.fi
180.RE
181.SH BUGS
182There is a maximum of 35 aliases, due to the way the
183.BR getservent (3)
184code is written.
185
186Lines longer than
187.B BUFSIZ
188(currently 1024) characters will be ignored by
189.BR getservent (3),
190.BR getservbyname (3),
191and
192.BR getservbyport (3).
193However, this will also cause the next line to be mis-parsed.
194.SH FILES
195.TP
196.I /etc/services
197The Internet network services list
198.TP
199.I /usr/include/netdb.h
200Definition of
201.B _PATH_SERVICES
202.SH "SEE ALSO"
203.BR listen (2),
204.BR endservent (3),
205.BR getservbyname (3),
206.BR getservbyport (3),
207.BR getservent (3),
208.BR setservent (3),
209.BR inetd.conf (5),
210.BR protocols (5),
211.BR inetd (8)
212
331da7c3 213Assigned Numbers RFC, most recently RFC\ 1700, (AKA STD0002)
fea681da
MK
214
215Guide to Yellow Pages Service
216
217Guide to BIND/Hesiod Service