OSDN Git Service

fa62ce2229a22b53a110b2987ce504f346a48b54
[linuxjm/LDP_man-pages.git] / release / man5 / services.5
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 Copyright (c) 1995 Martin Schulze
5 .\"     <joey@infodrom.north.de>
6 .\"
7 .\" Permission is granted to make and distribute verbatim copies of this
8 .\" manual provided the copyright notice and this permission notice are
9 .\" preserved on all copies.
10 .\"
11 .\" Permission is granted to copy and distribute modified versions of this
12 .\" manual under the conditions for verbatim copying, provided that the
13 .\" entire resulting derived work is distributed under the terms of a
14 .\" permission notice identical to this one.
15 .\" 
16 .\" Since the Linux kernel and libraries are constantly changing, this
17 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
18 .\" responsibility for errors or omissions, or for damages resulting from
19 .\" the use of the information contained herein.  The author(s) may not
20 .\" have taken the same level of care in the production of this manual,
21 .\" which is licensed free of charge, as they might when working
22 .\" professionally.
23 .\" 
24 .\" Formatted or processed versions of this manual, if unaccompanied by
25 .\" the source, must acknowledge the copyright and authors of this work.
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 .\"
34 .\" Japanese Version Copyright (c) 1997 MOTOKI Akihiro
35 .\"       all rights reserved.
36 .\" Translated Wed Aug 20 08:32:26 JST 1997
37 .\"       by MOTOKI Akihiro <motoki@hal.t.u-tokyo.ac.jp>
38 .\"
39 .TH SERVICES 5 2010-05-22 "Linux" "Linux Programmer's Manual"
40 .SH 名前
41 services \- インターネット ネットワークサービス リスト
42 .SH 説明
43 .B services
44 は、人が分かりやすい形のインターネットサービスの名前と、
45 それらのサービスに割り当てられたポート番号や
46 プロトコル種別の対応関係が書かれているテキストファイルである。
47 ネットワーク上で動作するプログラムはすべて、
48 そのサービスに対応するポート番号 (とプロトコル) を得るために、
49 このファイルを調べる必要がある。
50 C ライブラリ関数である
51 .BR getservent (3),
52 .BR getservbyname (3),
53 .BR getservbyport (3),
54 .BR setservent (3),
55 .BR endservent (3)
56 を利用することで、プログラムはこのファイルを調べることができる。
57
58 ポート番号は、IANA (Internet Assigned Numbers Authority) によって
59 割り当てられており、現在はポート番号を割り当てる際に
60 TCP と UDP の両方のプロトコルを割り当てることになっている。
61 そのため、ほとんどのサービスに対して、
62 たとえ TCP だけのサービスの場合であっても、対応する項目が二つあることになる。
63
64 1024 より小さいポート番号 (いわゆる "low numbered" ポート) は
65 管理者 (root) 権限によってのみ使用することができる
66 .RB ( bind (2), 
67 .BR tcp (7),
68 .BR udp (7)
69 参照)。
70 これは、これらのポートに接続するクライアントに対して、
71 そのポートで動いているサービスが標準的な実装であり、
72 その計算機のユーザーが動かしている
73 不正なサービスではないことを保証するためである。
74 IANA に明記されているよく使用されるポート番号は、
75 通常このような管理者だけが使用できる範囲に配置される。
76
77 .B services
78 ファイルにあるサービスに対する項目があっても、必ずしもそのサービスが現
79 在その計算機で動いている訳ではない。利用可能なインターネットサービスの設定に
80 ついては
81 .BR inetd.conf (5)
82 に記述されている。ただし、すべてのサービスが
83 .BR inetd (8)
84 によって起動されるわけではないので、
85 .BR inetd.conf (5)
86 には書かれていないサービスもあることに注意する必要がある。
87 特に、ネットニュース (NNTP) や メール (SMTP) のサーバーは、システム起動時の
88 スクリプトから起動されることが多い。
89
90 .B services
91 ファイルの場所は、
92 .I <netdb.h>
93 中の
94 .B _PATH_SERVICES
95 によって定義されている。
96 この値は通常
97 .I /etc/services
98 に設定されている。
99
100  1 行につき 1 サービスが記述されており、その形式は以下の通りである。
101 .IP
102 \f2service-name\ \ \ port\f3/\f2protocol\ \ \ \f1[\f2aliases ...\f1]
103 .TP
104 .TP 10
105 .I service-name
106 サービスを表す分かりやすい名前であり、検索の際にも使用される。
107 大文字と小文字は区別される。
108 クライアントプログラムは
109 .I service-name
110 にちなんで名付けられることが多い。
111 .TP
112 .I port
113 サービスに対して使用されるポート番号。10 進数で指定する。
114 .TP
115 .I protocol
116 使用されるプロトコルの種類。この欄は、
117 .BR protocols (5)
118 ファイルの中の項目と一致している必要がある。
119 通常使用される値は、
120 .B tcp
121
122 .B udp 
123 である。
124 .TP
125 .I aliases
126 サービスに対する別名のリスト (区切はスペースまたはタブ) で、この欄は
127 必要にならば書くことができる。
128 また、別名は大文字と小文字は区別される。
129 .PP
130 それぞれの欄の区切りには、スペースまたはタブが使用される。
131
132 コメントはシャープ (#) で始まり、その行の終わりまでがコメントとみなされる。
133 空行は飛ばされる。
134
135 行の始めのスペースは無視されないので、
136 .I service-name
137 は、行頭から書かなければならない。
138 .I service-names
139 は、スペースとタブ以外の印字可能な文字なら何でもよいが、しかしながら
140 互換性の問題を少なくするような文字を選択すべきである。
141 例えば、a\-z 、0\-9 、ハイフォン (\-) を使用するのが無難と思われる。
142
143 指定された形式に合わない行はあってはならない (現在は、そのような行は
144 .BR getservent (3),
145 .BR getservbyname (3),
146 .BR getservbyport (3)
147 によって無視される。しかし、その場合の挙動は信頼できない)。
148
149 .\" The following is not true as at glibc 2.8 (a line with a comma is
150 .\" ignored by getservent()); it's not clear if/when it was ever true.
151 .\"   古いバージョンとの整合性の問題から、実際には
152 .\"   .I port
153 .\"   番号と
154 .\"   .I protocol
155 .\"   の間のスラッシュ (/) は、スラッシュかコンマ (,) のどちらでも構わない。
156 .\"   しかしながら、今なおコンマを使用するのは望ましいことではない。
157 .\"   
158 このファイルは、Yellow Pages/NIS や BIND/Hesiod のようなネットワーク上の名前
159 サービスを用いて、ネットワークを通じて配布される可能性もある。
160
161 .B services
162 ファイルの見本を以下に示す。
163 .RS
164 .nf
165 .sp
166 .ta 3i
167 netstat         15/tcp
168 qotd            17/tcp          quote
169 msp             18/tcp          # message send protocol
170 msp             18/udp          # message send protocol
171 chargen         19/tcp          ttytst source
172 chargen         19/udp          ttytst source
173 ftp             21/tcp
174 # 22 \- unassigned
175 telnet          23/tcp
176 .fi
177 .RE
178 .SH ファイル
179 .TP
180 .I /etc/services
181 インターネット ネットワークサービスのリスト
182 .TP
183 .I <netdb.h>
184 .B _PATH_SERVICES
185 の定義
186 .\" .SH バグ
187 .\" It's not clear when/if the following was ever true;
188 .\" it isn't true for glibc 2.8:
189 .\"    .BR getservent (3)
190 .\"    のコードの書き方の問題で、35 個までしか別名を付けることができない。
191 .\"
192 .\" It's not clear when/if the following was ever true;
193 .\" it isn't true for glibc 2.8:
194 .\"   .B BUFSIZ
195 .\"   (現在は 1024) 文字より長い行は、
196 .\"   .BR getservent (3),
197 .\"   .BR getservbyname (3),
198 .\"   .BR getservbyport (3)
199 .\"   により無視される。さらに、このことは次の行が正しく解釈されない原因となる。
200 .SH 関連項目
201 .BR listen (2),
202 .BR endservent (3),
203 .BR getservbyname (3),
204 .BR getservbyport (3),
205 .BR getservent (3),
206 .BR setservent (3),
207 .BR inetd.conf (5),
208 .BR protocols (5),
209 .BR inetd (8)
210
211 ポート番号の割り当てを定めている RFC (最新版は RFC\ 1700、別名 STD0002)