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