今天打算把所有得网络服务都用xinetd来启动。找了几篇文章看了看。很快FTP,CVS,SSH都搞定了,然后配置Postgresql。死活起不来。于是去找
xinetd的官方文档,这才发现原来很多的文章都没有很详细地说明type这个参数得作用。我误以为象ssh那样省去Type也没有问题。下面是官方文档对type得说明:
xinetd can manage 3 types of services :
- RPC : for those defined in the /etc/rpc file...; but doesn't work very well;
- INTERNAL : for services directly managed by xinetd (echo, time, daytime, chargen and discard) ;
- UNLISTED : for services not defined either in the /etc/rpc file, or in the /etc/services file ;
Let's note it's possible to combine various values, as we'll see with servers, services and xadmin internal services.按我得理解翻译:
xinetd 可以管理3类服务:
- RPC:定义在/etc/rpc文件里得服务;(xinetd对这类服务得管理并不是十分的理想)
- INTERNAL:由xinetd直接管理的服务(echo, time, daytime, chargen 和 discard);
- UNLISTED:既没有在/etc/rpc 也没有在/etc/services中定义得服务。
我查看了/etc/rpc 和 /etc/services 里面并没有定义postgresql服务。所以应该使用
type = UNLISTED修改配置之后重启xinetd,posgresql启动成功。
我的posgresql服务配置如下:
service postgressql
{
socket_type = stream
type = UNLISTED
port = 5432
server = /etc/rc.d/postgresql
server_args = start
instances = 5
protocol = tcp
wait = no
user = root
}